[Python-checkins] cpython: Fix last remaining build issues of _ssl under old OpenSSLs. Patch by Vinay.

antoine.pitrou python-checkins at python.org
Sun Feb 19 21:26:01 CET 2012


http://hg.python.org/cpython/rev/1a06f0a8120f
changeset:   75043:1a06f0a8120f
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Feb 19 21:22:39 2012 +0100
summary:
  Fix last remaining build issues of _ssl under old OpenSSLs. Patch by Vinay.

files:
  Lib/test/test_ssl.py |  3 ++-
  Modules/_ssl.c       |  5 +++++
  2 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -102,7 +102,8 @@
         ssl.CERT_REQUIRED
         ssl.OP_CIPHER_SERVER_PREFERENCE
         ssl.OP_SINGLE_DH_USE
-        ssl.OP_SINGLE_ECDH_USE
+        if ssl.HAS_ECDH:
+            ssl.OP_SINGLE_ECDH_USE
         if ssl.OPENSSL_VERSION_INFO >= (1, 0):
             ssl.OP_NO_COMPRESSION
         self.assertIn(ssl.HAS_SNI, {True, False})
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -150,6 +150,11 @@
 # define OPENSSL_NO_ECDH
 #endif
 
+/* compression support got added to OpenSSL in 0.9.8 */
+#if OPENSSL_VERSION_NUMBER < 0x0090800fL && !defined(OPENSSL_NO_COMP)
+# define OPENSSL_NO_COMP
+#endif
+
 
 typedef struct {
     PyObject_HEAD

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list