@@ -370,6 +370,48 @@ The first 3 are enabled by default. The last 2 `CCM`-based suites are supported
370370by TLSv1.3 because they may be more performant on constrained systems, but they
371371are not enabled by default since they offer less security.
372372
373+ ## X509 Certificate Error codes
374+
375+ Multiple functions can fail due to certificate errors that are reported by
376+ OpenSSL. In such a case, the function provides a {Error} via its callback that
377+ has the property ` code ` which can take one of the following values:
378+
379+ <!--
380+ values are taken from src/crypto/crypto_common.cc
381+ description are taken from deps/openssl/openssl/crypto/x509/x509_txt.c
382+ -->
383+ * ` 'UNABLE_TO_GET_ISSUER_CERT' ` : Unable to get issuer certificate,
384+ * ` 'UNABLE_TO_GET_CRL' ` : Unable to get certificate CRL,
385+ * ` 'UNABLE_TO_DECRYPT_CERT_SIGNATURE' ` : Unable to decrypt certificate's
386+ signature,
387+ * ` 'UNABLE_TO_DECRYPT_CRL_SIGNATURE' ` : Unable to decrypt CRL's signature,
388+ * ` 'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY' ` : Unable to decode issuer public key,
389+ * ` 'CERT_SIGNATURE_FAILURE' ` : Certificate signature failure,
390+ * ` 'CRL_SIGNATURE_FAILURE' ` : CRL signature failure,
391+ * ` 'CERT_NOT_YET_VALID' ` : Certificate is not yet valid,
392+ * ` 'CERT_HAS_EXPIRED' ` : Certificate has expired,
393+ * ` 'CRL_NOT_YET_VALID' ` : CRL is not yet valid,
394+ * ` 'CRL_HAS_EXPIRED' ` : CRL has expired,
395+ * ` 'ERROR_IN_CERT_NOT_BEFORE_FIELD' ` : Format error in certificate's notBefore
396+ field,
397+ * ` 'ERROR_IN_CERT_NOT_AFTER_FIELD' ` : Format error in certificate's notAfter
398+ field,
399+ * ` 'ERROR_IN_CRL_LAST_UPDATE_FIELD' ` : Format error in CRL's lastUpdate field,
400+ * ` 'ERROR_IN_CRL_NEXT_UPDATE_FIELD' ` : Format error in CRL's nextUpdate field,
401+ * ` 'OUT_OF_MEM' ` : Out of memory,
402+ * ` 'DEPTH_ZERO_SELF_SIGNED_CERT' ` : Self signed certificate,
403+ * ` 'SELF_SIGNED_CERT_IN_CHAIN' ` : Self signed certificate in certificate chain,
404+ * ` 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' ` : Unable to get local issuer certificate,
405+ * ` 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' ` : Unable to verify the first certificate,
406+ * ` 'CERT_CHAIN_TOO_LONG' ` : Certificate chain too long,
407+ * ` 'CERT_REVOKED' ` : Certificate revoked,
408+ * ` 'INVALID_CA' ` : Invalid CA certificate,
409+ * ` 'PATH_LENGTH_EXCEEDED' ` : Path length constraint exceeded,
410+ * ` 'INVALID_PURPOSE' ` : Unsupported certificate purpose,
411+ * ` 'CERT_UNTRUSTED' ` : Certificate not trusted,
412+ * ` 'CERT_REJECTED' ` : Certificate rejected,
413+ * ` 'HOSTNAME_MISMATCH' ` : Hostname mismatch,
414+
373415## Class: ` tls.CryptoStream `
374416<!-- YAML
375417added: v0.3.4
0 commit comments