summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-08 16:47:06 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-08 16:47:06 (GMT)
commitb9ac25d1c394714f0565845b274e7eebb402f1e7 (patch)
treeab68b24e92248ffd54b256fe8e7c38d67d63b2bd /Lib
parent6e2e3b9e8188acca0d40df365f3d9595fad59991 (diff)
downloadcpython-b9ac25d1c394714f0565845b274e7eebb402f1e7.zip
cpython-b9ac25d1c394714f0565845b274e7eebb402f1e7.tar.gz
cpython-b9ac25d1c394714f0565845b274e7eebb402f1e7.tar.bz2
Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against, rather than the runtime version of the OpenSSL library.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ssl.py2
-rw-r--r--Lib/test/test_ssl.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index e9e9aa8..ce9ebdf 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -77,6 +77,8 @@ from _ssl import (
)
from _ssl import HAS_SNI
from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
+from _ssl import _OPENSSL_API_VERSION
+
_PROTOCOL_NAMES = {
PROTOCOL_TLSv1: "TLSv1",
PROTOCOL_SSLv23: "SSLv23",
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 7edf5b2..869381a 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -60,7 +60,7 @@ def handle_error(prefix):
def can_clear_options():
# 0.9.8m or higher
- return ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 13, 15)
+ return ssl._OPENSSL_API_VERSION >= (0, 9, 8, 13, 15)
def no_sslv2_implies_sslv3_hello():
# 0.9.7h or higher