diff options
author | Ingela Anderton Andin <[email protected]> | 2017-06-16 19:13:50 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-07-07 15:54:19 +0200 |
commit | 47740707d585b275f08b4f0900f854cb87f0e825 (patch) | |
tree | 2faa96504c42dc8684855bc01d4bfed0e5a1a1a5 | |
parent | 3514f176a55db0c9052c3857c6fcba35726945dc (diff) | |
download | otp-47740707d585b275f08b4f0900f854cb87f0e825.tar.gz otp-47740707d585b275f08b4f0900f854cb87f0e825.tar.bz2 otp-47740707d585b275f08b4f0900f854cb87f0e825.zip |
ssl: Try to make asn1 decode errors of certificates as specific as possible
-rw-r--r-- | lib/ssl/src/ssl_handshake.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 5110f2d271..b1661624b5 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -415,9 +415,11 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbHandle, CertDbRef, path_validation_alert(Reason) end catch - error:_ -> + error:{badmatch,{asn1, Asn1Reason}} -> %% ASN-1 decode of certificate somehow failed - ?ALERT_REC(?FATAL, ?CERTIFICATE_UNKNOWN, failed_to_decode_certificate) + ?ALERT_REC(?FATAL, ?CERTIFICATE_UNKNOWN, {failed_to_decode_certificate, Asn1Reason}); + error:OtherReason -> + ?ALERT_REC(?FATAL, ?INTERNAL_ERROR, {unexpected_error, OtherReason}) end. %%-------------------------------------------------------------------- |