I just upgraded to 7.31.0, and testing my software against it, I see some of my SSL/TLS unit tests are now failing with:
* SSL read: error:00000000:lib(0):func(0):reason(0), errno 0
* Closing connection 1
This doesn't look right, as it seems to be failing with no error whatsoever.
I bisected the issue to this commit: https://github.com/bagder/curl/commit/520833cbe1601feed1c6473bd28c4c894e7ee63e
As we all know, OpenSSL documentation is woefully incomplete, and the library has many bizare issues. But after looking at whatever documentation I can find, the best I can come up with is that in some cases, OpenSSL's SSL_read() returns zero, because the underlying read() or recv() returned 0, and that this is not an error, yet curl's existing code does not handle this.
I'm including a test case where in previous versions, curl seems to work fine, and in newer versions, curl fails.
I also whipped up a patch which I'm including for curl's OpenSSL code to actually check that errno from OpenSSL is indeed reporting an error instead of assuming it. With this patch, I no longer have SSL/TLS problems with my test case.
curl 7.31.0 (x86_64-unknown-linux-gnu) libcurl/7.31.0 OpenSSL/1.0.1e zlib/1.2.8
Protocols: file http https
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP