[pypy-commit] pypy default: disable protocols not available on python2

mattip pypy.commits at gmail.com
Sat May 25 16:14:22 EDT 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r96683:c8dfd959151f
Date: 2019-05-25 23:07 +0300
http://bitbucket.org/pypy/pypy/changeset/c8dfd959151f/

Log:	disable protocols not available on python2

diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
--- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
@@ -87,8 +87,8 @@
     PROTOCOL_TLSv1 = 3
     PROTOCOL_TLSv1_1 = 4
     PROTOCOL_TLSv1_2 = 5
-PROTOCOL_TLS_CLIENT = 0x10
-PROTOCOL_TLS_SERVER = 0x11
+# PROTOCOL_TLS_CLIENT = 0x10
+# PROTOCOL_TLS_SERVER = 0x11
 
 _PROTOCOL_NAMES = (name for name in dir(lib) if name.startswith('PROTOCOL_'))
 
@@ -777,10 +777,10 @@
             method = lib.SSLv2_method()
         elif protocol == PROTOCOL_SSLv23:
             method = lib.SSLv23_method()
-        elif protocol == PROTOCOL_TLS_CLIENT:
-            method = lib.SSLv23_client_method()
-        elif protocol == PROTOCOL_TLS_SERVER:
-            method = lib.SSLv23_server_method()
+        # elif protocol == PROTOCOL_TLS_CLIENT:
+        #     method = lib.SSLv23_client_method()
+        # elif protocol == PROTOCOL_TLS_SERVER:
+        #     method = lib.SSLv23_server_method()
         else:
             raise ValueError("invalid protocol version")
 
@@ -791,7 +791,7 @@
 
         # Don't check host name by default
         self._check_hostname = False
-        if protocol == PROTOCOL_TLS_CLIENT:
+        if 0 and protocol == PROTOCOL_TLS_CLIENT:
             self._check_hostname = True
             self.verify_mode = CERT_REQUIRED
         else:


More information about the pypy-commit mailing list