openssl / openssl

TLS/SSL and crypto library
https://www.openssl.org
Apache License 2.0
25.59k stars 10.09k forks source link

Improve error message when the connection is terminated during handshake #4706

Open minfrin opened 6 years ago

minfrin commented 6 years ago

If an openssl client v1.0.2m makes a connection to an SSL server, and if the server disconnects the connection without saying anything (zero bytes are sent), openssl doesn't explicitly declare this in the error message.

While in theory this is a handshake failure, there is no attempt to log why the handshake failed.

Would it be correct to add an additional line before

-> 177 SSLerr(SSL_F_SSL23_WRITE, SSL_R_SSL_HANDSHAKE_FAILURE);

to state that the remote server terminated the connection unexpectedly?

Or are there other types of handshake failures that could cause is to reach this line with n equal to zero?

(lldb) run Process 8811 launched: './apps/openssl' (i386) CONNECTED(00000003) Process 8811 stopped

nhorman commented 3 months ago

https://github.com/openssl/openssl/issues/12921