components/python/python27/patches/26-sslv2.patch
author John Beck <John.Beck@Oracle.COM>
Tue, 20 Dec 2016 13:25:44 -0800
changeset 7516 09c933391a1b
parent 6445 0edecb568b2e
permissions -rw-r--r--
25293039 Upgrade Python 2.7 line to 2.7.13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4733
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     1
This patch comes from in-house, to deal with SSLv2 no longer being supported.
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     2
As it is Solaris-specific, it will not be passed upstream.
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     3
7516
09c933391a1b 25293039 Upgrade Python 2.7 line to 2.7.13
John Beck <John.Beck@Oracle.COM>
parents: 6445
diff changeset
     4
--- Python-2.7.13/Lib/test/test_ssl.py.~2~	2016-12-19 08:44:58.900357184 +0000
09c933391a1b 25293039 Upgrade Python 2.7 line to 2.7.13
John Beck <John.Beck@Oracle.COM>
parents: 6445
diff changeset
     5
+++ Python-2.7.13/Lib/test/test_ssl.py	2016-12-19 08:44:58.942536627 +0000
6445
0edecb568b2e 23858073 Upgrade Python 2.7 line to 2.7.12
John Beck <John.Beck@Oracle.COM>
parents: 4733
diff changeset
     6
@@ -25,6 +25,9 @@
4733
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     7
 ssl = support.import_module("ssl")
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     8
 
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     9
 PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
+if hasattr(ssl, 'PROTOCOL_SSLv2'):
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
+    delattr(ssl, 'PROTOCOL_SSLv2')
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
+    PROTOCOLS.remove(0)
87d0de8972c0 21381333 Python 2.7 regression test test_ssl fails
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    13
 HOST = support.HOST
7516
09c933391a1b 25293039 Upgrade Python 2.7 line to 2.7.13
John Beck <John.Beck@Oracle.COM>
parents: 6445
diff changeset
    14
 IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
09c933391a1b 25293039 Upgrade Python 2.7 line to 2.7.13
John Beck <John.Beck@Oracle.COM>
parents: 6445
diff changeset
    15
 IS_OPENSSL_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)