33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
|
From 4fa35e8b1ebb2a8e88ba7c4c9cd2a17b35638ee6 Mon Sep 17 00:00:00 2001
|
||
|
From: Dimitri John Ledkov <xnox@ubuntu.com>
|
||
|
Date: Fri, 28 Sep 2018 16:34:16 +0100
|
||
|
Subject: [PATCH] bpo-34834: Fix test_ssl.test_options to account for
|
||
|
OP_ENABLE_MIDDLEBOX_COMPAT.
|
||
|
|
||
|
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
|
||
|
|
||
|
https://bugs.python.org/issue34834
|
||
|
---
|
||
|
Lib/test/test_ssl.py | 5 +++++
|
||
|
1 file changed, 5 insertions(+)
|
||
|
|
||
|
Index: Python-2.7.15/Lib/test/test_ssl.py
|
||
|
===================================================================
|
||
|
--- Python-2.7.15.orig/Lib/test/test_ssl.py 2018-10-29 13:32:59.190865648 +0100
|
||
|
+++ Python-2.7.15/Lib/test/test_ssl.py 2018-10-29 13:41:01.857624490 +0100
|
||
|
@@ -777,8 +777,12 @@ class ContextTests(unittest.TestCase):
|
||
|
default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
|
||
|
# SSLContext also enables these by default
|
||
|
default |= (ssl.OP_NO_COMPRESSION | ssl.OP_CIPHER_SERVER_PREFERENCE |
|
||
|
- ssl.OP_SINGLE_DH_USE | ssl.OP_SINGLE_ECDH_USE |
|
||
|
- ssl.OP_ENABLE_MIDDLEBOX_COMPAT)
|
||
|
+ ssl.OP_SINGLE_DH_USE | ssl.OP_SINGLE_ECDH_USE)
|
||
|
+ if not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1):
|
||
|
+ # define MIDDLEBOX constant, as python2.7 does not know about it
|
||
|
+ # but it is used by default.
|
||
|
+ OP_ENABLE_MIDDLEBOX_COMPAT = 1048576L
|
||
|
+ default |= OP_ENABLE_MIDDLEBOX_COMPAT
|
||
|
self.assertEqual(default, ctx.options)
|
||
|
ctx.options |= ssl.OP_NO_TLSv1
|
||
|
self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options)
|