@@ -370,6 +370,47 @@ The first 3 are enabled by default. The last 2 `CCM`-based suites are supported
370
370
by TLSv1.3 because they may be more performant on constrained systems, but they
371
371
are not enabled by default since they offer less security.
372
372
373
+
374
+ ## X509 Certificate Error codes
375
+
376
+ Multiple functions can fail due to certificate errors that are reported by
377
+ openssl. In such a case, the function provides a ` Error ` via its callback that
378
+ has the property ` code ` which can take one of the following values:
379
+
380
+ <!--
381
+ values are taken from src/crypto/crypto_common.cc
382
+ description are taken from deps/openssl/openssl/crypto/x509/x509_txt.c
383
+ -->
384
+ * ` 'UNABLE_TO_GET_ISSUER_CERT' ` : unable to get issuer certificate
385
+ * ` 'UNABLE_TO_GET_CRL' ` : unable to get certificate CRL
386
+ * ` 'UNABLE_TO_DECRYPT_CERT_SIGNATURE' ` : unable to decrypt certificate's 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 field
396
+ * ` 'ERROR_IN_CERT_NOT_AFTER_FIELD' ` : format error in certificate's notAfter field
397
+ * ` 'ERROR_IN_CRL_LAST_UPDATE_FIELD' ` : format error in CRL's lastUpdate field
398
+ * ` 'ERROR_IN_CRL_NEXT_UPDATE_FIELD' ` : format error in CRL's nextUpdate field
399
+ * ` 'OUT_OF_MEM' ` : out of memory
400
+ * ` 'DEPTH_ZERO_SELF_SIGNED_CERT' ` : self signed certificate
401
+ * ` 'SELF_SIGNED_CERT_IN_CHAIN' ` : self signed certificate in certificate chain
402
+ * ` 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' ` : unable to get local issuer certificate
403
+ * ` 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' ` : unable to verify the first certificate
404
+ * ` 'CERT_CHAIN_TOO_LONG' ` : certificate chain too long
405
+ * ` 'CERT_REVOKED' ` : certificate revoked
406
+ * ` 'INVALID_CA' ` : invalid CA certificate
407
+ * ` 'PATH_LENGTH_EXCEEDED' ` : path length constraint exceeded
408
+ * ` 'INVALID_PURPOSE' ` : unsupported certificate purpose
409
+ * ` 'CERT_UNTRUSTED' ` : certificate not trusted
410
+ * ` 'CERT_REJECTED' ` : certificate rejected
411
+ * ` 'HOSTNAME_MISMATCH' ` : Hostname mismatch
412
+
413
+
373
414
## Class: ` tls.CryptoStream `
374
415
<!-- YAML
375
416
added: v0.3.4
0 commit comments