Workflow Tools Control Yard

Home / Linux

OpenSSL verify errors and command builder

Paste the line where OpenSSL reports a verify error, such as verify error:num=20 and the text after it, or type the number or its name. The page gives OpenSSL's name and text for the error, what OpenSSL's documentation says about it and what to check. Below it, build openssl commands that convert PFX and PEM files, make a key and a certificate request with SANs, and check a certificate chain.

The depth in the message

openssl verify writes a failure as error 20 at 0 depth lookup: and the text. The depth says which certificate failed: 0 is the server's own certificate, 1 the CA certificate that signed it, and so on up the chain.

What to check

NumberWhat to check
2A CA certificate found in the trusted store has an issuer that is not there. OpenSSL's documentation says this normally means the list of trusted certificates is not complete: add the missing CA certificate to the store, or pass it with -CAfile.
9A certificate is not valid yet: check the clock of this computer, and the certificate's notBefore date.
10A certificate has expired: check its notAfter date, and the clock of this computer.
18The server's own certificate is self-signed and not trusted here. Trust it on purpose, or give the server a certificate from a CA that this computer trusts.
19The chain ends in a self-signed root that is not in the trusted store: a private CA, or a device that inspects TLS. Add the root to the trusted store if it is yours, or pass it with -CAfile.
20The issuer of a certificate that the server sent is neither among the certificates it sent nor in the trusted store. Check whether the server leaves out an intermediate certificate (compare what openssl s_client -showcerts lists with the chain the CA gave), and whether the root is in the store that this OpenSSL uses.
21Only one certificate came in and it is not self-signed, so OpenSSL could check no signature: its issuer is not in the trusted store. Check that the server sends its intermediate certificates.
62The certificate is not for the name that was asked for. Compare the name you connect to with the certificate's subjectAltName list.

Command builder

Command

openssl pkcs12 -in site.pfx -out site.pem -noenc
Task
Files and names
Options

The commands are for OpenSSL 3.0 and later, where -noenc took the place of -nodes; the manuals of OpenSSL 3.5 and 4.1 both list every option they use. Without -legacy, OpenSSL encrypts a PFX with AES-256-CBC. With it, OpenSSL loads its legacy provider and uses the older algorithms, such as 3DES. OpenSSL's manual suggests -legacy when a PFX made with an older algorithm, such as RC2-40-CBC, does not load.

Verify errors

Every verify error of OpenSSL 4.1, 105 of them. The nine marked are not in OpenSSL 3.5: 96 to 101 came with OpenSSL 3.6, 102 and 103 with 4.0, and 104 with 4.1. The others have the same numbers and names in OpenSSL 3.5. The text is what OpenSSL prints; the description is from OpenSSL's documentation, where it has one.

NumberNameTextOpenSSL's description
0X509_V_OKokThe operation was successful.
1X509_V_ERR_UNSPECIFIEDunspecified certificate verification errorUnspecified error; should not happen.
2X509_V_ERR_UNABLE_TO_GET_ISSUER_CERTunable to get issuer certificateThe issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete. To allow any certificate (not only a self-signed one) in the trust store to terminate the chain the X509_V_FLAG_PARTIAL_CHAIN flag may be set.
3X509_V_ERR_UNABLE_TO_GET_CRLunable to get certificate CRLThe CRL of a certificate could not be found.
4X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATUREunable to decrypt certificate's signatureThe certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value, this is only meaningful for RSA keys.
5X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATUREunable to decrypt CRL's signatureThe CRL signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused.
6X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEYunable to decode issuer public keyThe public key in the certificate SubjectPublicKeyInfo field could not be read.
7X509_V_ERR_CERT_SIGNATURE_FAILUREcertificate signature failureThe signature of the certificate is invalid.
8X509_V_ERR_CRL_SIGNATURE_FAILURECRL signature failureThe signature of the CRL is invalid.
9X509_V_ERR_CERT_NOT_YET_VALIDcertificate is not yet valid or the system clock is incorrect (OpenSSL 3.5: certificate is not yet valid)The certificate is not yet valid: the notBefore date is after the current time.
10X509_V_ERR_CERT_HAS_EXPIREDcertificate has expiredThe certificate has expired: that is the notAfter date is before the current time.
11X509_V_ERR_CRL_NOT_YET_VALIDCRL is not yet validThe CRL is not yet valid.
12X509_V_ERR_CRL_HAS_EXPIREDCRL has expiredThe CRL has expired.
13X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELDformat error in certificate's notBefore fieldThe certificate notBefore field contains an invalid time.
14X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELDformat error in certificate's notAfter fieldThe certificate notAfter field contains an invalid time.
15X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELDformat error in CRL's lastUpdate fieldThe CRL lastUpdate field contains an invalid time.
16X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELDformat error in CRL's nextUpdate fieldThe CRL nextUpdate field contains an invalid time.
17X509_V_ERR_OUT_OF_MEMout of memoryAn error occurred trying to allocate memory.
18X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERTself-signed certificateThe passed certificate is self-signed and the same certificate cannot be found in the list of trusted certificates.
19X509_V_ERR_SELF_SIGNED_CERT_IN_CHAINself-signed certificate in certificate chainThe certificate chain could be built up using the untrusted certificates but no suitable trust anchor (which typically is a self-signed root certificate) could be found in the trust store.
20X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLYunable to get local issuer certificateThe issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found.
21X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATUREunable to verify the first certificateNo signatures could be verified because the chain contains only one certificate and it is not self-signed and the X509_V_FLAG_PARTIAL_CHAIN flag is not set.
22X509_V_ERR_CERT_CHAIN_TOO_LONGcertificate chain too longThe certificate chain length is greater than the supplied maximum depth.
23X509_V_ERR_CERT_REVOKEDcertificate revokedThe certificate has been revoked.
24X509_V_ERR_NO_ISSUER_PUBLIC_KEYissuer certificate doesn't have a public keyThe issuer certificate does not have a public key.
25X509_V_ERR_PATH_LENGTH_EXCEEDEDpath length constraint exceededThe basicConstraints path-length parameter has been exceeded.
26X509_V_ERR_INVALID_PURPOSEunsuitable certificate purposeThe target certificate cannot be used for the specified purpose.
27X509_V_ERR_CERT_UNTRUSTEDcertificate not trustedThe root CA is not marked as trusted for the specified purpose.
28X509_V_ERR_CERT_REJECTEDcertificate rejectedThe root CA is marked to reject the specified purpose.
29X509_V_ERR_SUBJECT_ISSUER_MISMATCHsubject issuer mismatchThe current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate.
30X509_V_ERR_AKID_SKID_MISMATCHauthority and subject key identifier mismatchThe current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate.
31X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCHauthority and issuer serial number mismatchThe current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate.
32X509_V_ERR_KEYUSAGE_NO_CERTSIGNkey usage does not include certificate signingThe current candidate issuer certificate was rejected because its keyUsage extension does not permit certificate signing.
33X509_V_ERR_UNABLE_TO_GET_CRL_ISSUERunable to get CRL issuer certificateUnable to get CRL issuer certificate.
34X509_V_ERR_UNHANDLED_CRITICAL_EXTENSIONunhandled critical extensionUnhandled critical extension.
35X509_V_ERR_KEYUSAGE_NO_CRL_SIGNkey usage does not include CRL signingKey usage does not include CRL signing.
36X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSIONunhandled critical CRL extensionUnhandled critical CRL extension.
37X509_V_ERR_INVALID_NON_CAinvalid non-CA certificate (has CA markings)Invalid non-CA certificate has CA markings.
38X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDEDproxy path length constraint exceededProxy path length constraint exceeded.
39X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATUREkey usage does not include digital signatureKey usage does not include digital signature, and therefore cannot sign certificates.
40X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWEDproxy certificates not allowed, please set the appropriate flagProxy certificates not allowed unless the X509_V_FLAG_ALLOW_PROXY_CERTS flag is set.
41X509_V_ERR_INVALID_EXTENSIONinvalid or inconsistent certificate extensionA certificate extension had an invalid value (for example an incorrect encoding) or some value inconsistent with other extensions.
42X509_V_ERR_INVALID_POLICY_EXTENSIONinvalid or inconsistent certificate policy extensionA certificate policies extension had an invalid value (for example an incorrect encoding) or some value inconsistent with other extensions. This error only occurs if policy processing is enabled.
43X509_V_ERR_NO_EXPLICIT_POLICYno explicit policyThe verification flags were set to require and explicit policy but none was present.
44X509_V_ERR_DIFFERENT_CRL_SCOPEdifferent CRL scopeThe only CRLs that could be found did not match the scope of the certificate.
45X509_V_ERR_UNSUPPORTED_EXTENSION_FEATUREunsupported extension featureSome feature of a certificate extension is not supported. Unused.
46X509_V_ERR_UNNESTED_RESOURCERFC 3779 resource not subset of parent's resourcesSee RFC 3779 for details.
47X509_V_ERR_PERMITTED_VIOLATIONpermitted subtree violationA name constraint violation occurred in the permitted subtrees.
48X509_V_ERR_EXCLUDED_VIOLATIONexcluded subtree violationA name constraint violation occurred in the excluded subtrees.
49X509_V_ERR_SUBTREE_MINMAXname constraints minimum and maximum not supportedA certificate name constraints extension included a minimum or maximum field: this is not supported.
50X509_V_ERR_APPLICATION_VERIFICATIONapplication verification failureAn application specific error. This will never be returned unless explicitly set by an application callback.
51X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPEunsupported name constraint typeAn unsupported name constraint type was encountered. OpenSSL currently only supports directory name, DNS name, email and URI types.
52X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAXunsupported or invalid name constraint syntaxThe format of the name constraint is not recognised: for example an email address format of a form not mentioned in RFC3280. This could be caused by a garbage extension or some new feature not currently supported.
53X509_V_ERR_UNSUPPORTED_NAME_SYNTAXunsupported or invalid name syntaxUnsupported or invalid name syntax.
54X509_V_ERR_CRL_PATH_VALIDATION_ERRORCRL path validation errorAn error occurred when attempting to verify the CRL path. This error can only happen if extended CRL checking is enabled.
55X509_V_ERR_PATH_LOOPpath loopPath loop.
56X509_V_ERR_SUITE_B_INVALID_VERSIONSuite B: certificate version invalid
57X509_V_ERR_SUITE_B_INVALID_ALGORITHMSuite B: invalid public key algorithm
58X509_V_ERR_SUITE_B_INVALID_CURVESuite B: invalid ECC curve
59X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHMSuite B: invalid signature algorithm
60X509_V_ERR_SUITE_B_LOS_NOT_ALLOWEDSuite B: curve not allowed for this LOS
61X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256Suite B: cannot sign P-384 with P-256
62X509_V_ERR_HOSTNAME_MISMATCHhostname mismatchHostname mismatch.
63X509_V_ERR_EMAIL_MISMATCHemail address mismatchEmail address mismatch.
64X509_V_ERR_IP_ADDRESS_MISMATCHIP address mismatchIP address mismatch.
65X509_V_ERR_DANE_NO_MATCHno matching DANE TLSA recordsDANE TLSA authentication is enabled, but no TLSA records matched the certificate chain. This error is only possible in openssl-s_client(1).
66X509_V_ERR_EE_KEY_TOO_SMALLEE certificate key too weakEE certificate key too weak.
67X509_V_ERR_CA_KEY_TOO_SMALLCA certificate key too weakCA certificate key too weak.
68X509_V_ERR_CA_MD_TOO_WEAKCA signature digest algorithm too weakCA signature digest algorithm too weak.
69X509_V_ERR_INVALID_CALLinvalid certificate verification contextInvalid certificate verification context.
70X509_V_ERR_STORE_LOOKUPissuer certificate lookup errorIssuer certificate lookup error.
71X509_V_ERR_NO_VALID_SCTSCertificate Transparency required, but no valid SCTs foundCertificate Transparency required, but no valid SCTs found.
72X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATIONproxy subject name violationProxy subject name violation.
73X509_V_ERR_OCSP_VERIFY_NEEDEDOCSP verification neededReturned by the verify callback to indicate an OCSP verification is needed.
74X509_V_ERR_OCSP_VERIFY_FAILEDOCSP verification failedReturned by the verify callback to indicate OCSP verification failed.
75X509_V_ERR_OCSP_CERT_UNKNOWNOCSP unknown certReturned by the verify callback to indicate that the certificate is not recognized by the OCSP responder.
76X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHMCannot find certificate signature algorithmCannot find certificate signature algorithm.
77X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCHsubject signature algorithm and issuer public key algorithm mismatchThe issuer's public key is not of the type required by the signature in the subject's certificate.
78X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCYcert info signature and signature algorithm mismatchThe algorithm given in the certificate info is inconsistent with the one used for the certificate signature.
79X509_V_ERR_INVALID_CAinvalid CA certificateA CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose.
80X509_V_ERR_PATHLEN_INVALID_FOR_NON_CAPath length invalid for non-CA cert
81X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGNPath length given without key usage keyCertSign
82X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CAKey usage keyCertSign invalid for non-CA cert
83X509_V_ERR_ISSUER_NAME_EMPTYIssuer name empty
84X509_V_ERR_SUBJECT_NAME_EMPTYSubject name empty
85X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIERMissing Authority Key IdentifierMissing Authority Key Identifier.
86X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIERMissing Subject Key Identifier
87X509_V_ERR_EMPTY_SUBJECT_ALT_NAMEEmpty Subject Alternative Name extension
88X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICALSubject empty and Subject Alt Name extension not critical
89X509_V_ERR_CA_BCONS_NOT_CRITICALBasic Constraints of CA cert not marked critical
90X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICALAuthority Key Identifier marked critical
91X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICALSubject Key Identifier marked critical
92X509_V_ERR_CA_CERT_MISSING_KEY_USAGECA cert does not include key usage extension
93X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3Using cert extension requires at least X509v3
94X509_V_ERR_EC_KEY_EXPLICIT_PARAMSCertificate public key has explicit ECC parameters
95X509_V_ERR_RPK_UNTRUSTEDRaw public key untrusted, no trusted keys configuredNo TLS records were configured to validate the raw public key, or DANE was not enabled on the connection.
96X509_V_ERR_OCSP_RESP_INVALIDOCSP response(s) invalid (OpenSSL 3.6 and later)Returned by the verify callback to indicate that one or more OCSP responses are invalid.
97X509_V_ERR_OCSP_SIGNATURE_FAILUREOCSP response signature verification failure (OpenSSL 3.6 and later)Returned by the verify callback to indicate OCSP response signature verification failed.
98X509_V_ERR_OCSP_NOT_YET_VALIDOCSP response not yet valid (contains a date in the future) (OpenSSL 3.6 and later)Returned by the verify callback to indicate that OCSP response has a thisUpdate date in the future.
99X509_V_ERR_OCSP_HAS_EXPIREDOCSP response has expired (OpenSSL 3.6 and later)Returned by the verify callback to indicate that the OCSP response has expired.
100X509_V_ERR_OCSP_NO_RESPONSEno OCSP response available for certificate (OpenSSL 3.6 and later)Returned by the verify callback to indicate that no OCSP response is available for the certificate.
101X509_V_ERR_CRL_VERIFY_FAILEDunknown certificate verification error (OpenSSL 4.1 has no text of its own for this number) (OpenSSL 3.6 and later)
102X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIEREmpty Authority Key Identifier (OpenSSL 4.0 and later)Authority Key Identifier has no attributes.
103X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIREDAuthority Key Identifier issuer and serial number must be paired (OpenSSL 4.0 and later)Authority Key Identifier issuer and serial number must be paired.
104X509_V_ERR_DUPLICATE_EXTENSIONCertificate includes more than one instance of a particular extension (OpenSSL 4.1 and later)Certificate includes more than one instance of a particular extension.

Sources

More Linux tools