'Is it possible to get used TLS version information?

I'm using the following code:

curl_easy_setopt( curl_ptr, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_2 );

But I have reason to believe it's not actually using TLS 1.2 still. I was hoping to confirm it somehow, but I can't find what allows you to pull this information from the API.

Is it possible to do so?



Solution 1:[1]

I know this is a c++ question, but in python newest version (3.10) the min req for OpenSSL changed which yielded interrupts in connections made to "outdated" servers that use a lower version of OpenSSL. Sadly, there is no way that you as a client can easily know the versions used by the server.

What you can do is manually changing the versions or even the ciphers used and see which one works, therefore guessing the version the server is using.

If you are having connection issues, I would simple downgrade the library being used. If you want to actually keep using it and enforce newer TLS and SSL standards you need to be aware that older servers might enforce the downgrading.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Raul Jerlach