Fix OSS_PDU_RANGE (0x80093003) ASN.1 Decoding Error
This error means a certificate or ASN.1 structure is malformed. Here's how to fix it without wasting time.
You see OSS_PDU_RANGE 0x80093003 and just want it gone.
I get it. You're trying to import a certificate, run a script, or validate a file, and Windows throws this cryptic ASN.1 decoding error. Happened to a client last month who spent two hours googling before calling me. The fix isn't complicated—you just need to know what's actually causing it.
The real fix: regenerate the certificate or file with proper DER encoding
This error means the data doesn't follow the ASN.1 Distinguished Encoding Rules (DER) standard. Most of the time, it's a certificate or PKCS#7 file that got corrupted during export, copy-paste, or a bad CSR generation.
Here's what works in 9 out of 10 cases:
- Re-export the certificate using the correct format. If you're working with a .cer or .p7b file, open the certificate in the original issuing machine's certificate store. Export it again, but choose "Base-64 encoded X.509" first, then convert it to DER using certutil:
certutil -encode input.cer output.cer
Or better, export directly as DER binary. - Use OpenSSL to verify and re-encode. This is my go-to. Run:
If you have a PKCS#7 file (.p7b), do:openssl x509 -in broken.cer -inform PEM -outform DER -out fixed.cer
Theopenssl pkcs7 -in broken.p7b -inform PEM -outform DER -out fixed.p7b-inform PEMflag matters—many online converters leave garbage headers. - Strip any extra whitespace or line breaks. I've seen this error from a single extra newline at the end of a PEM file. Open the file in Notepad++ (or any hex editor), check the last few bytes. Should end with
0D 0Aor just0Afor a blank line, but nothing else.
Why does this work?
ASN.1 DER is strict about byte alignment and tag-length-value encoding. When Windows CryptoAPI encounters a byte that doesn't match the expected PDU (Protocol Data Unit) range, it throws 0x80093003. The error code literally means "the data unit is outside the valid range." Common triggers:
- A corrupted certificate chain with an extra byte in the middle
- A CSR generated by an old tool that doesn't pad INTEGERs correctly
- Copy-pasting a base64 certificate from an email client that wraps lines at 76 characters (Outlook does this) and leaves a stray space
Re-encoding forces the data into proper DER structure. OpenSSL catches padding errors automatically. Windows doesn't—it just fails.
Less common variations of this error
Sometimes the error isn't from a certificate file but from a script or application that generates ASN.1 data internally. Had a client whose PowerShell script failed with 0x80093003 when trying to sign a document. The issue was a missing [System.Text.Encoding]::UTF8.GetBytes() conversion—he was passing a Unicode string directly to a CryptoAPI function expecting a byte array.
Another scenario: third-party VPN clients (looking at you, old OpenVPN versions) that use malformed PKCS#12 files. If you get this error during VPN connection, re-export your client certificate from the CA using the latest OpenSSL with -legacy flag if needed:
openssl pkcs12 -export -in cert.pem -inkey key.pem -out fixed.p12 -legacy
If the error appears in Event Viewer under System with source Schannel, it's a TLS handshake failure. The server sent a certificate the client couldn't decode. Run certutil -viewstore -enterprise to check the server's certificate chain for expired or malformed intermediate CAs.
Prevention (so you don't see this again)
Stop copy-pasting certificates from emails directly into the MMC snap-in. Always save as a file, then import via certlm.msc or certmgr.msc. Use OpenSSL to verify any certificate before deployment:
openssl x509 -in cert.cer -text -noout
If it chokes, the file is bad.
For developers: if you're generating ASN.1 structures in code, use a library like Bouncy Castle or the built-in .NET System.Security.Cryptography.X509Certificates classes. Don't manually concatenate bytes—CryptoAPI will punish you.
Keep your root CA certificates updated. Microsoft releases monthly updates via Windows Update that fix DER parsing issues in schannel.dll. I've seen this error disappear after a simple update.
One last thing: if you're using a self-signed certificate generated by an old tool (like selfssl.exe from IIS 6.0), throw it away. Those things produce non-standard DER. Use PowerShell's New-SelfSignedCertificate or OpenSSL instead.
Was this solution helpful?