summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-03-28 21:24:43 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-03-28 21:24:43 (GMT)
commit2463e5fee48b116a5f15cf703abe30e08ce114ca (patch)
tree17224b1adc4440741f050658a0b1615b23b80319 /Lib/ssl.py
parentf2c64ed9eb649e83e6c6d7e16ab1752f97ef7fa6 (diff)
downloadcpython-2463e5fee48b116a5f15cf703abe30e08ce114ca.zip
cpython-2463e5fee48b116a5f15cf703abe30e08ce114ca.tar.gz
cpython-2463e5fee48b116a5f15cf703abe30e08ce114ca.tar.bz2
Issue #16692: The ssl module now supports TLS 1.1 and TLS 1.2. Initial patch by Michele OrrĂ¹.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index c8311bc..021ae35 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -52,6 +52,8 @@ PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLSv1
+PROTOCOL_TLSv1_1
+PROTOCOL_TLSv1_2
The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6
@@ -110,8 +112,7 @@ _import_symbols('SSL_ERROR_')
from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN
-from _ssl import (PROTOCOL_SSLv3, PROTOCOL_SSLv23,
- PROTOCOL_TLSv1)
+from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
from _ssl import _OPENSSL_API_VERSION
@@ -128,6 +129,14 @@ except ImportError:
else:
_PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
+try:
+ from _ssl import PROTOCOL_TLSv1_1, PROTOCOL_TLSv1_2
+except ImportError:
+ pass
+else:
+ _PROTOCOL_NAMES[PROTOCOL_TLSv1_1] = "TLSv1.1"
+ _PROTOCOL_NAMES[PROTOCOL_TLSv1_2] = "TLSv1.2"
+
from socket import getnameinfo as _getnameinfo
from socket import socket, AF_INET, SOCK_STREAM, create_connection
import base64 # for DER-to-PEM translation