I am working on an app that needs to talk to different HTTPS servers. There are cases where server simply ignore SSL/TLS Client Hello (no Server Hello is returned).
The problem would exhibit itself in code as such:
>curl32.exe -v -k --tlsv1 https://...
* timeout on name lookup is not supported
* About to connect() to <server> port 443 (#0)
* Trying <IP>...
* connected
* Connected to <server> (<IP>) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: ./cacert.test.pem
CApath: none
* Unknown SSL protocol error in connection to <Server>:443
* Closing connection #0
===> CURLcode is: 35
The returned code is: CURLE_SSL_CONNECT_ERROR
When running from OpenSsl directly, this would be ok:
OpenSSL> s_client -tls1 -connect <server>:443
I have tried various combination (specify TLS, SSL or not specify). The only common thing when problem happens is when the SSL/TLS version is inconsistent. So in WireShark I will see, under TCP, Secure Socket Layer:
- SSL Record Layer: Handshake Protocol: Client Hello <===
- Version: TLS 1.0 (0x0301)
- ...
- Handshake Protocol: Client Hello
- ...
- Version: TLS 1.0 (0x0301)
In the correct case where I will see Server Hello from server I will see:
- TLSv1 Record Layer: Handshake Protocol: Client Hello <===
- Version: TLS 1.0 (0x0301)
- ...
- Handshake Protocol: Client Hello
- ...
- Version: TLS 1.0 (0x0301)
I am not completely sure it is the libcurl issue, or maybe the WireShark is not decoding it correctly (as the Record Layer in both cases look almost identical, and the 2 Version fields are correct), making libcurl appears to be the problem.
Any thoughts? Ideas? Similar experience? Any help much appreciated!!