Simple code:
procedure TForm1.Button1Click(Sender: TObject); //var //h: tIdHTTP; //SSL: TIdSSLIOHandlerSocketOpenSSL; begin h.IOHandler := SSL; SSL.SSLOptions.Method := sslvTLSv1_2; SSL.SLLOptions.SSLVersion := [sslvTLSv1_2]; //must be set automatically after SetMethod, but just to be sure h.Get('https://www.deviantart.com/users/login'); end;
This simple code gives me an error:
Error connecting to SSL.
Error: 14094410: SSL routines: ssl3_read_bytes: sslv3 rejection of a handshake message
I use the Delphi XE3 and OpenSSL 1.0.2b libraries. I can’t understand this, looking at the sources, in the connection initiation there are lines that disable unused versions:
if not (sslvSSLv2 in SSLVersions) then begin SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv2); end; if not (sslvSSLv3 in SSLVersions) then begin SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv3); end; if not (sslvTLSv1 in SSLVersions) then begin SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1); end;
But sslv3 operations still arise. Not like a component error. Is something internal or indy library not taking something into account when setting parameters?
Or is it really me who has not noticed something important? I really hope that I don’t need to go through hell called “updating Indy components”.
Test for (tried all methods, including TLS1.2) https://www.deviantart.com/users/login
Resolving hostname www.deviantart.com. Connecting to 54.230.96.81. Handshake Start: before/connect initialization Connect Loop: before/connect initialization Connect Loop: SSLv3 write client hello A fatal Read Alert: handshake failure Connect Failed: SSLv3 read server hello A ERROR: Error connecting with SSL. error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
- for the result, SSL3 and TLS1 / 1.1 / 1.2 are identical;
- for SSLv23 responses SSL23_GET_SERVER_HELLO: crash on sslv3 message failure;
- for SSLv2 not responding;
Testing on a similar resource (ONLY ONLY ONLY TLS1) https://files.yande.re/image/da9afa6d9ca43a9f154fad69f76adb85.jpg
Resolving hostname files.yande.re. Connecting to 5.39.10.56. Handshake Start: before/connect initialization Connect Loop: before/connect initialization Connect Loop: SSLv3 write client hello A Connect Loop: SSLv3 read server hello A Connect Loop: SSLv3 read server certificate A Connect Loop: SSLv3 read server key exchange A Connect Loop: SSLv3 read server done A Connect Loop: SSLv3 write client key exchange A Connect Loop: SSLv3 write change cipher spec A Connect Loop: SSLv3 write finished A Connect Loop: SSLv3 flush data Connect Loop: SSLv3 read server session ticket A Connect Loop: SSLv3 read finished A Handshake Done: SSL negotiation finished successfully Connect Exit: SSL negotiation finished successfully
My WireShark tests:
- Indy:
http://imgur.com/BZ84Cl3 (the answer is a handshake failure); - Firefox:
http://imgur.com/pkYJvnO ; - Response to a Firefox request:
http://imgur.com/M9ni3TV ;