Determine default protocol version used by SSL package?
<p>In python, how can I determine which SSL or TLS protocol is used by SSL package, or requests, by default.</p>

<p>As in, say TLSv1 vs SSLv3.</p>

<p>The <a href="https://docs.python.org/2/library/ssl.html#socket-creation" rel="nofollow">SSL socket creation</a> section of the Python docs has the information on the SSL package:</p>

<blockquote>
  <p>The parameter <code>ssl_version</code> specifies which version of the SSL
  protocol to use. Typically, the server chooses a particular protocol
  version, and the client must adapt to the serverâs choice. Most of the
  versions are not interoperable with the other versions. If not
  specified, the default is
  <a href="https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_SSLv23" rel="nofollow">PROTOCOL_SSLv23</a>
  it provides the most compatibility with other versions.</p>
  
  <p>Hereâs a table showing which versions in a client (down the side) can
  connect to which versions in a server (along the top):</p>

<pre><code>| client / server | SSLv2 | SSLv3 | SSLv23 | TLSv1 | TLSv1.1 | TLSv1.2 |
|-----------------|-------|-------|--------|-------|---------|---------|
| SSLv2           | yes   | no    | yes    | no    | no      | no      |
| SSLv3           | no    | yes   | yes    | no    | no      | no      |
| SSLv23          | no    | yes   | yes    | yes   | yes     | yes     |
| TLSv1           | no    | no    | yes    | yes   | no      | no      |
| TLSv1.1         | no    | no    | yes    | no    | yes     | no      |
| TLSv1.2         | no    | no    | yes    | no    | no      | yes     |
</code></pre>
  
  <blockquote>
    <p><strong>Note:</strong></p>
    
    <p>Which connections succeed will vary depending on the version of
    OpenSSL. For example, before OpenSSL 1.0.0, an SSLv23 client would
    always attempt SSLv2 connections.</p>
  </blockquote>
</blockquote>

python ssl python-requests pyopenssl