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
| Number | What to check |
|---|---|
| 2 | A 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. |
| 9 | A certificate is not valid yet: check the clock of this computer, and the certificate's notBefore date. |
| 10 | A certificate has expired: check its notAfter date, and the clock of this computer. |
| 18 | The 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. |
| 19 | The 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. |
| 20 | The 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. |
| 21 | Only 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. |
| 62 | The 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
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.
| Number | Name | Text | OpenSSL's description |
|---|---|---|---|
| 0 | X509_V_OK | ok | The operation was successful. |
| 1 | X509_V_ERR_UNSPECIFIED | unspecified certificate verification error | Unspecified error; should not happen. |
| 2 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT | unable to get issuer certificate | The 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. |
| 3 | X509_V_ERR_UNABLE_TO_GET_CRL | unable to get certificate CRL | The CRL of a certificate could not be found. |
| 4 | X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE | unable to decrypt certificate's signature | The 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. |
| 5 | X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE | unable to decrypt CRL's signature | The 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. |
| 6 | X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY | unable to decode issuer public key | The public key in the certificate SubjectPublicKeyInfo field could not be read. |
| 7 | X509_V_ERR_CERT_SIGNATURE_FAILURE | certificate signature failure | The signature of the certificate is invalid. |
| 8 | X509_V_ERR_CRL_SIGNATURE_FAILURE | CRL signature failure | The signature of the CRL is invalid. |
| 9 | X509_V_ERR_CERT_NOT_YET_VALID | certificate 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. |
| 10 | X509_V_ERR_CERT_HAS_EXPIRED | certificate has expired | The certificate has expired: that is the notAfter date is before the current time. |
| 11 | X509_V_ERR_CRL_NOT_YET_VALID | CRL is not yet valid | The CRL is not yet valid. |
| 12 | X509_V_ERR_CRL_HAS_EXPIRED | CRL has expired | The CRL has expired. |
| 13 | X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD | format error in certificate's notBefore field | The certificate notBefore field contains an invalid time. |
| 14 | X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD | format error in certificate's notAfter field | The certificate notAfter field contains an invalid time. |
| 15 | X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD | format error in CRL's lastUpdate field | The CRL lastUpdate field contains an invalid time. |
| 16 | X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD | format error in CRL's nextUpdate field | The CRL nextUpdate field contains an invalid time. |
| 17 | X509_V_ERR_OUT_OF_MEM | out of memory | An error occurred trying to allocate memory. |
| 18 | X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT | self-signed certificate | The passed certificate is self-signed and the same certificate cannot be found in the list of trusted certificates. |
| 19 | X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN | self-signed certificate in certificate chain | The 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. |
| 20 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY | unable to get local issuer certificate | The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found. |
| 21 | X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE | unable to verify the first certificate | No 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. |
| 22 | X509_V_ERR_CERT_CHAIN_TOO_LONG | certificate chain too long | The certificate chain length is greater than the supplied maximum depth. |
| 23 | X509_V_ERR_CERT_REVOKED | certificate revoked | The certificate has been revoked. |
| 24 | X509_V_ERR_NO_ISSUER_PUBLIC_KEY | issuer certificate doesn't have a public key | The issuer certificate does not have a public key. |
| 25 | X509_V_ERR_PATH_LENGTH_EXCEEDED | path length constraint exceeded | The basicConstraints path-length parameter has been exceeded. |
| 26 | X509_V_ERR_INVALID_PURPOSE | unsuitable certificate purpose | The target certificate cannot be used for the specified purpose. |
| 27 | X509_V_ERR_CERT_UNTRUSTED | certificate not trusted | The root CA is not marked as trusted for the specified purpose. |
| 28 | X509_V_ERR_CERT_REJECTED | certificate rejected | The root CA is marked to reject the specified purpose. |
| 29 | X509_V_ERR_SUBJECT_ISSUER_MISMATCH | subject issuer mismatch | The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate. |
| 30 | X509_V_ERR_AKID_SKID_MISMATCH | authority and subject key identifier mismatch | The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate. |
| 31 | X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH | authority and issuer serial number mismatch | The 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. |
| 32 | X509_V_ERR_KEYUSAGE_NO_CERTSIGN | key usage does not include certificate signing | The current candidate issuer certificate was rejected because its keyUsage extension does not permit certificate signing. |
| 33 | X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER | unable to get CRL issuer certificate | Unable to get CRL issuer certificate. |
| 34 | X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION | unhandled critical extension | Unhandled critical extension. |
| 35 | X509_V_ERR_KEYUSAGE_NO_CRL_SIGN | key usage does not include CRL signing | Key usage does not include CRL signing. |
| 36 | X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION | unhandled critical CRL extension | Unhandled critical CRL extension. |
| 37 | X509_V_ERR_INVALID_NON_CA | invalid non-CA certificate (has CA markings) | Invalid non-CA certificate has CA markings. |
| 38 | X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED | proxy path length constraint exceeded | Proxy path length constraint exceeded. |
| 39 | X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE | key usage does not include digital signature | Key usage does not include digital signature, and therefore cannot sign certificates. |
| 40 | X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED | proxy certificates not allowed, please set the appropriate flag | Proxy certificates not allowed unless the X509_V_FLAG_ALLOW_PROXY_CERTS flag is set. |
| 41 | X509_V_ERR_INVALID_EXTENSION | invalid or inconsistent certificate extension | A certificate extension had an invalid value (for example an incorrect encoding) or some value inconsistent with other extensions. |
| 42 | X509_V_ERR_INVALID_POLICY_EXTENSION | invalid or inconsistent certificate policy extension | A 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. |
| 43 | X509_V_ERR_NO_EXPLICIT_POLICY | no explicit policy | The verification flags were set to require and explicit policy but none was present. |
| 44 | X509_V_ERR_DIFFERENT_CRL_SCOPE | different CRL scope | The only CRLs that could be found did not match the scope of the certificate. |
| 45 | X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE | unsupported extension feature | Some feature of a certificate extension is not supported. Unused. |
| 46 | X509_V_ERR_UNNESTED_RESOURCE | RFC 3779 resource not subset of parent's resources | See RFC 3779 for details. |
| 47 | X509_V_ERR_PERMITTED_VIOLATION | permitted subtree violation | A name constraint violation occurred in the permitted subtrees. |
| 48 | X509_V_ERR_EXCLUDED_VIOLATION | excluded subtree violation | A name constraint violation occurred in the excluded subtrees. |
| 49 | X509_V_ERR_SUBTREE_MINMAX | name constraints minimum and maximum not supported | A certificate name constraints extension included a minimum or maximum field: this is not supported. |
| 50 | X509_V_ERR_APPLICATION_VERIFICATION | application verification failure | An application specific error. This will never be returned unless explicitly set by an application callback. |
| 51 | X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE | unsupported name constraint type | An unsupported name constraint type was encountered. OpenSSL currently only supports directory name, DNS name, email and URI types. |
| 52 | X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX | unsupported or invalid name constraint syntax | The 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. |
| 53 | X509_V_ERR_UNSUPPORTED_NAME_SYNTAX | unsupported or invalid name syntax | Unsupported or invalid name syntax. |
| 54 | X509_V_ERR_CRL_PATH_VALIDATION_ERROR | CRL path validation error | An error occurred when attempting to verify the CRL path. This error can only happen if extended CRL checking is enabled. |
| 55 | X509_V_ERR_PATH_LOOP | path loop | Path loop. |
| 56 | X509_V_ERR_SUITE_B_INVALID_VERSION | Suite B: certificate version invalid | |
| 57 | X509_V_ERR_SUITE_B_INVALID_ALGORITHM | Suite B: invalid public key algorithm | |
| 58 | X509_V_ERR_SUITE_B_INVALID_CURVE | Suite B: invalid ECC curve | |
| 59 | X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM | Suite B: invalid signature algorithm | |
| 60 | X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED | Suite B: curve not allowed for this LOS | |
| 61 | X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 | Suite B: cannot sign P-384 with P-256 | |
| 62 | X509_V_ERR_HOSTNAME_MISMATCH | hostname mismatch | Hostname mismatch. |
| 63 | X509_V_ERR_EMAIL_MISMATCH | email address mismatch | Email address mismatch. |
| 64 | X509_V_ERR_IP_ADDRESS_MISMATCH | IP address mismatch | IP address mismatch. |
| 65 | X509_V_ERR_DANE_NO_MATCH | no matching DANE TLSA records | DANE TLSA authentication is enabled, but no TLSA records matched the certificate chain. This error is only possible in openssl-s_client(1). |
| 66 | X509_V_ERR_EE_KEY_TOO_SMALL | EE certificate key too weak | EE certificate key too weak. |
| 67 | X509_V_ERR_CA_KEY_TOO_SMALL | CA certificate key too weak | CA certificate key too weak. |
| 68 | X509_V_ERR_CA_MD_TOO_WEAK | CA signature digest algorithm too weak | CA signature digest algorithm too weak. |
| 69 | X509_V_ERR_INVALID_CALL | invalid certificate verification context | Invalid certificate verification context. |
| 70 | X509_V_ERR_STORE_LOOKUP | issuer certificate lookup error | Issuer certificate lookup error. |
| 71 | X509_V_ERR_NO_VALID_SCTS | Certificate Transparency required, but no valid SCTs found | Certificate Transparency required, but no valid SCTs found. |
| 72 | X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION | proxy subject name violation | Proxy subject name violation. |
| 73 | X509_V_ERR_OCSP_VERIFY_NEEDED | OCSP verification needed | Returned by the verify callback to indicate an OCSP verification is needed. |
| 74 | X509_V_ERR_OCSP_VERIFY_FAILED | OCSP verification failed | Returned by the verify callback to indicate OCSP verification failed. |
| 75 | X509_V_ERR_OCSP_CERT_UNKNOWN | OCSP unknown cert | Returned by the verify callback to indicate that the certificate is not recognized by the OCSP responder. |
| 76 | X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM | Cannot find certificate signature algorithm | Cannot find certificate signature algorithm. |
| 77 | X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH | subject signature algorithm and issuer public key algorithm mismatch | The issuer's public key is not of the type required by the signature in the subject's certificate. |
| 78 | X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY | cert info signature and signature algorithm mismatch | The algorithm given in the certificate info is inconsistent with the one used for the certificate signature. |
| 79 | X509_V_ERR_INVALID_CA | invalid CA certificate | A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose. |
| 80 | X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA | Path length invalid for non-CA cert | |
| 81 | X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN | Path length given without key usage keyCertSign | |
| 82 | X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA | Key usage keyCertSign invalid for non-CA cert | |
| 83 | X509_V_ERR_ISSUER_NAME_EMPTY | Issuer name empty | |
| 84 | X509_V_ERR_SUBJECT_NAME_EMPTY | Subject name empty | |
| 85 | X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER | Missing Authority Key Identifier | Missing Authority Key Identifier. |
| 86 | X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER | Missing Subject Key Identifier | |
| 87 | X509_V_ERR_EMPTY_SUBJECT_ALT_NAME | Empty Subject Alternative Name extension | |
| 88 | X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL | Subject empty and Subject Alt Name extension not critical | |
| 89 | X509_V_ERR_CA_BCONS_NOT_CRITICAL | Basic Constraints of CA cert not marked critical | |
| 90 | X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL | Authority Key Identifier marked critical | |
| 91 | X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL | Subject Key Identifier marked critical | |
| 92 | X509_V_ERR_CA_CERT_MISSING_KEY_USAGE | CA cert does not include key usage extension | |
| 93 | X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 | Using cert extension requires at least X509v3 | |
| 94 | X509_V_ERR_EC_KEY_EXPLICIT_PARAMS | Certificate public key has explicit ECC parameters | |
| 95 | X509_V_ERR_RPK_UNTRUSTED | Raw public key untrusted, no trusted keys configured | No TLS records were configured to validate the raw public key, or DANE was not enabled on the connection. |
| 96 | X509_V_ERR_OCSP_RESP_INVALID | OCSP response(s) invalid (OpenSSL 3.6 and later) | Returned by the verify callback to indicate that one or more OCSP responses are invalid. |
| 97 | X509_V_ERR_OCSP_SIGNATURE_FAILURE | OCSP response signature verification failure (OpenSSL 3.6 and later) | Returned by the verify callback to indicate OCSP response signature verification failed. |
| 98 | X509_V_ERR_OCSP_NOT_YET_VALID | OCSP 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. |
| 99 | X509_V_ERR_OCSP_HAS_EXPIRED | OCSP response has expired (OpenSSL 3.6 and later) | Returned by the verify callback to indicate that the OCSP response has expired. |
| 100 | X509_V_ERR_OCSP_NO_RESPONSE | no 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. |
| 101 | X509_V_ERR_CRL_VERIFY_FAILED | unknown certificate verification error (OpenSSL 4.1 has no text of its own for this number) (OpenSSL 3.6 and later) | |
| 102 | X509_V_ERR_EMPTY_AUTHORITY_KEY_IDENTIFIER | Empty Authority Key Identifier (OpenSSL 4.0 and later) | Authority Key Identifier has no attributes. |
| 103 | X509_V_ERR_AKID_ISSUER_SERIAL_NOT_PAIRED | Authority Key Identifier issuer and serial number must be paired (OpenSSL 4.0 and later) | Authority Key Identifier issuer and serial number must be paired. |
| 104 | X509_V_ERR_DUPLICATE_EXTENSION | Certificate 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
- Numbers, names and texts: OpenSSL's include/openssl/x509_vfy.h.in and crypto/x509/x509_txt.c at openssl-3.5.9 and openssl-4.1.0; the release of the new numbers: x509_vfy.h.in at openssl-3.6.0 and openssl-4.0.0; descriptions: X509_STORE_CTX_get_error(3) at openssl-4.1.0; the depth: openssl-verify(1).
- Commands: the manual pages openssl-pkcs12, openssl-req, openssl-x509, openssl-pkey, openssl-s_client, openssl-verify, openssl-verification-options and openssl-passphrase-options at openssl-3.5.9 and at openssl-4.1.0.
- OpenSSL is under the Apache License 2.0; its texts and descriptions are shown as data, and the words around them are written here in plain words.
More Linux tools
-
Exit code, signal and errno lookup
Look up 137, 139, 143 or any other exit code, a signal such as SIGKILL, or an errno value such as 111.
-
curl error code lookup
Read curl: (6), (7), (28), (35), (60) or any other curl error, with libcurl's name and what to check.
-
chmod and umask calculator
Turn 755 into rwxr-xr-x and back, build a chmod command, and see what a umask leaves on new files.
-
Cron expression explainer
Read a crontab line such as */15 8-18 * * 1-5 in words, see its next runs, or build a schedule.