I am using TIdSSLIOHandlerSocketOpenSSL to open a TLS/SSL connection. I currently want to support tls 1.0 to 1.2.
I initialize the IOHandler like this.
TIdSSLIOHandlerSocketOpenSSL(FSocket.IOHandler).SSLOptions.SSLVersions := [sslvTLSv1_2,sslvTLSv1_1, sslvTLSv1];
After the connection is made, how can I get which protocol was negotiated for the connection? (Both for ensuring the configuration of both the client and test server is correct, and eventually for statistics purpose).
I checked SSLContext.Method
after the connection, but it still shows sslvSSLv23
after the connection. SSLContext.SSLVersions
shows [sslvTLSv1_2,sslvTLSv1_1, sslvTLSv1]
.
So how do I get that information?
Cipher.Version
doesn't seem to contain the current protocol in use (Or I'm seriously missing something). If, for example, I force using only TLS1.1 on the client,Cipher.Version
returns 'TLSv1/SSLv3'. I'm going to look into SSL_get_version. – Outclass