I've attached a small patch for the openssl egg that adds another error status.
This status is 'ssl-eof when the error is SSL_ERR_SYSCALL but the return code is zero.
According to the OpenSSL docs under the BUGS section:
> The SSL_ERROR_SYSCALL eith errno value of 0 indicates unexpected EOF from the peer.
> This will be properly reported as SSL_ERROR_SSL with reason code
> SSL_R_UNEXPECTED_EOF_WHILE_READING in the OpenSSL 3.0 release because it is truly a
> TLS protocol error to terminate the connection without a SSL_shutdown().
> The issue is kept unfixed in OpenSSL 1.1.1 releases because many applications which
> choose to ignore this protocol error depend on the existing way of reporting the error.
Basically this gives the user the option to treat it is as an !#eof instead of a fatal error.
I've been running into this issue while building a Gemini client where there are a
plethora of servers written by hobbyists. Also, the protocol does not have a Content-Length header,
which means I can't avoid this issue by simply not reading past the end.