Your code selects TLS 1.2
in the SSLOptions property Method
:
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1_2;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.SSLVersions := [sslvTLSv1_2];
However, two lines later this value is overwritten with SSL 3
:
with IdSSLIOHandlerSocketOpenSSL1 do begin
SSLOptions.Method := sslvSSLv3;
...
end;
So the client will not connect with the newer TLS 1.2 protocol but with SSL 3, which is no longer supported by the server.
This explains the error message, which says that the SSL 3 handshake (which the client tried) failed:
SSL. error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake
failure'
If you remove the second assignment, the IdHTTP client will use TLS 1.2 for the connect.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…