For the record, I've been observing consistent SSL handshake failures for about two days now, when sending = on an SMTP service. I'm using a local indigenous freemail service, pretty popular, but I don't want to name them in this context :-) I'm in touch with their helpdesk, who have made quite some effort to help me, considering that this is a free service.
For a few months, I've been running the 4.81 beta: namely 4.81.1154, dated Jan 10 2023.
Among intelligible strings inside its tcpip.dll, I've noticed OpenSSL v1.1.1q . That's relatively fresh, but at the same time it belongs to the classic OpenSSL code strain/pedigree that's been frowned upon a lot during the last decades and has recently stopped getting patches. (At times like these, it would be nice to have the SSL library pedigree and version mentioned in the About dialogue...)
I'm referring to the schism around OpenSSL many years ago, when LibreTLS got forked, and then OpenSSL forked the 3.x family as its own "inside job of a codebase overhaul", initially bringing some wrinkles of its own, which later got rectified... And then there's also the GnuTLS...
The day before yesterday, the failures used to contain the error code "-1/5" (my assumption: SSL_do_handshake() = -1, SSL_get_error() = 5). I assume this points to the error known in ssl.h as SSL_ERROR_SYSCALL . As has been mentioned in this thread already, this error is not very specific in the way of pointing a finger at the culprit, yet it does have a reasonably clear local meaning: the underlying layer of communication (aka "BIO", namely probably the TCP session) has disconnected. Something just closed the socket without much explanation - possibly the opposite party, i.e. the server. BTW when an SSL_ERROR_SYSCALL occurs, another additional error code could immediately be obtained from the standard libc "errno" (not reported by PMail). Yet it would probably not reveal much further information (I'd hazard my guess at EPIPE or some such).
Interestingly, today I can see PMail report a different error: "SSL_read returned zero (socket was closed)" . Which sounds fairly similar to the previous error and analysis.
I have tried watching the session using a locally running instance of Wireshark at the client machine. I have some captures... essentially the server does "answer the call" (accept and handle the socket), the initial SSL greetings are exchanged, then the server says "change cipher" (plus some encrypted payload), obtains a plain TCP ACK from the client, then the client says "change cipher" (plus some encrypted payload), in response to which the server hangs up the TCP session (FIN, FIN+ACK, actually nailed by an RST).
As Wireshark cannot see into even the early encrypted stages of the SSL session, I've tried a locally running mitmproxy - namely in its "local mode", pointed to a particular binary (winpm-32.exe) where it just hooks any TCP sessions originated by the requested binary.
This didn't show any payload passed through the SSL session - and yes the session handshake still failed. Mitmproxy did report the TCP session getting established, and then a failed SSL handshake, with no payload making it through. Read: probably no SMTP welcome exchange, no auth. Which matches what my freemail provider's helpdesk would say: no authentication attempt in their logs, on those sessions.
I then tried "openssl.exe s_client -connect smtp.freemail.censored:465", which connected just fine, and I got a welcome message from the SMTP service (and it responded to my "quit"
. I've also observed the respective few rows of cleartext SMTP in the mitmproxy output. That was using openssl.exe from OpenSSL 3.5.0 = a current version, as installed in Windows by Chocolatey. Still on the same Windows machine running PMail.
So, to sum up, the attempt to start SSL to port 465 fails from Pegasus (OpenSSL 1.1.1q), but succeeds from OpenSSL 3.5.0. If I compare wireshark traces, there is not much difference, until in the case of Pegasus, the server does a graceful shutdown of the TCP session, without a word of SMTP explanation.
Interestingly, an SMTP session on port 587, from Pegasus using STARTTLS, towards the same server machine with the same credentials, works just fine :-)
I wonder what flavours and versions of the SSL library are used on those two "SMTP submission" ports - but I have not learned those details (which makes good sense).
Thanks for your attention everyone...
and thanks David & Co. for Pegasus :-)
Frank
For the record, I've been observing consistent SSL handshake failures for about two days now, when sending = on an SMTP service. I'm using a local indigenous freemail service, pretty popular, but I don't want to name them in this context :-) I'm in touch with their helpdesk, who have made quite some effort to help me, considering that this is a free service.
For a few months, I've been running the 4.81 beta: namely 4.81.1154, dated Jan 10 2023.
Among intelligible strings inside its tcpip.dll, I've noticed OpenSSL v1.1.1q . That's relatively fresh, but at the same time it belongs to the classic OpenSSL code strain/pedigree that's been frowned upon a lot during the last decades and has recently stopped getting patches. (At times like these, it would be nice to have the SSL library pedigree and version mentioned in the About dialogue...)
I'm referring to the schism around OpenSSL many years ago, when LibreTLS got forked, and then OpenSSL forked the 3.x family as its own "inside job of a codebase overhaul", initially bringing some wrinkles of its own, which later got rectified... And then there's also the GnuTLS...
The day before yesterday, the failures used to contain the error code "-1/5" (my assumption: SSL_do_handshake() = -1, SSL_get_error() = 5). I assume this points to the error known in ssl.h as SSL_ERROR_SYSCALL . As has been mentioned in this thread already, this error is not very specific in the way of pointing a finger at the culprit, yet it does have a reasonably clear local meaning: the underlying layer of communication (aka "BIO", namely probably the TCP session) has disconnected. Something just closed the socket without much explanation - possibly the opposite party, i.e. the server. BTW when an SSL_ERROR_SYSCALL occurs, another additional error code could immediately be obtained from the standard libc "errno" (not reported by PMail). Yet it would probably not reveal much further information (I'd hazard my guess at EPIPE or some such).
Interestingly, today I can see PMail report a different error: "SSL_read returned zero (socket was closed)" . Which sounds fairly similar to the previous error and analysis.
I have tried watching the session using a locally running instance of Wireshark at the client machine. I have some captures... essentially the server does "answer the call" (accept and handle the socket), the initial SSL greetings are exchanged, then the server says "change cipher" (plus some encrypted payload), obtains a plain TCP ACK from the client, then the client says "change cipher" (plus some encrypted payload), in response to which the server hangs up the TCP session (FIN, FIN+ACK, actually nailed by an RST).
As Wireshark cannot see into even the early encrypted stages of the SSL session, I've tried a locally running mitmproxy - namely in its "local mode", pointed to a particular binary (winpm-32.exe) where it just hooks any TCP sessions originated by the requested binary.
This didn't show any payload passed through the SSL session - and yes the session handshake still failed. Mitmproxy did report the TCP session getting established, and then a failed SSL handshake, with no payload making it through. Read: probably no SMTP welcome exchange, no auth. Which matches what my freemail provider's helpdesk would say: no authentication attempt in their logs, on those sessions.
I then tried "openssl.exe s_client -connect smtp.freemail.censored:465", which connected just fine, and I got a welcome message from the SMTP service (and it responded to my "quit"). I've also observed the respective few rows of cleartext SMTP in the mitmproxy output. That was using openssl.exe from OpenSSL 3.5.0 = a current version, as installed in Windows by Chocolatey. Still on the same Windows machine running PMail.
So, to sum up, the attempt to start SSL to port 465 fails from Pegasus (OpenSSL 1.1.1q), but succeeds from OpenSSL 3.5.0. If I compare wireshark traces, there is not much difference, until in the case of Pegasus, the server does a graceful shutdown of the TCP session, without a word of SMTP explanation.
Interestingly, an SMTP session on port 587, from Pegasus using STARTTLS, towards the same server machine with the same credentials, works just fine :-)
I wonder what flavours and versions of the SSL library are used on those two "SMTP submission" ports - but I have not learned those details (which makes good sense).
Thanks for your attention everyone...
and thanks David & Co. for Pegasus :-)
Frank