diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-12 11:23:09 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-12 11:23:09 (GMT) |
commit | 0041142785b347b757dc881247b59850ec7d2f4e (patch) | |
tree | 793a121fe69d8b58d2d4a6fc1a612feed3df8ceb /Lib | |
parent | d2a296a73a3a49d15fd3d1505c10e98ab8ad1a63 (diff) | |
download | cpython-0041142785b347b757dc881247b59850ec7d2f4e.zip cpython-0041142785b347b757dc881247b59850ec7d2f4e.tar.gz cpython-0041142785b347b757dc881247b59850ec7d2f4e.tar.bz2 |
Issue #22935: Fix ssl module when SSLv3 protocol is not supported
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ssl.py | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -116,18 +116,14 @@ def _import_symbols(prefix): _import_symbols('OP_') _import_symbols('ALERT_DESCRIPTION_') _import_symbols('SSL_ERROR_') +_import_symbols('PROTOCOL_') from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN -from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1 from _ssl import _OPENSSL_API_VERSION -_PROTOCOL_NAMES = { - PROTOCOL_TLSv1: "TLSv1", - PROTOCOL_SSLv23: "SSLv23", - PROTOCOL_SSLv3: "SSLv3", -} +_PROTOCOL_NAMES = {value: name for name, value in globals().items() if name.startswith('PROTOCOL_')} try: from _ssl import PROTOCOL_SSLv2 _SSLv2_IF_EXISTS = PROTOCOL_SSLv2 |