On a Windows 10 machine, I’ve set up an OpenSSL 3.3 project via vcpkg, and compiled the example program they provided at https://github.com/openssl/openssl/blob/master/demos/guide/tls-client-block.c
I tried to make a HTTPS request to www.openssl.org:443 with this program (full command line: tls-client-block www.openssl.org 443
), but the connection failed with the log output:
Failed to connect to the server
2C7C0000:error:0A000126:SSL routines::unexpected eof while reading:sslrecordrec_layer_s3.c:692:
Consulting the documentation, there is an option you can set to mitigate this, SSL_OP_IGNORE_UNEXPECTED_EOF
, but setting that option doesn’t resolve the main problem – the connection still fails, only one step later, ending in a SSL_ERROR_ZERO_RETURN
.
Attempting the connection with wget https://www.openssl.org:443/
does work; as does the web browser, unsurprisingly. But I’m not sure if either of these are using OpenSSL in the back, since I don’t think it’s a system library on Windows.
It appears that the server simply rejects the client as configured in the official example and I don’t yet know enough about TLS in general, and OpenSSL in particular, to figure out why this happens. I’d be grateful for some pointers.
lo-asys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.