Fix last remaining build issues of _ssl under old OpenSSLs. Patch by Vinay.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 19 Feb 2012 20:22:39 +0000 (21:22 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 19 Feb 2012 20:22:39 +0000 (21:22 +0100)
Lib/test/test_ssl.py
Modules/_ssl.c

index 33f06d6cab891b8c568048f0858a416c97d1f69d..c6ce07545cd53a7250870b18bffc62a4f3f93685 100644 (file)
@@ -102,7 +102,8 @@ class BasicSocketTests(unittest.TestCase):
         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})
index 8225e68f1d4e1aa66425ed2c26f681c86c92d56e..690d0be647cc17fd30caa8a31203cb56eb2adaa1 100644 (file)
@@ -150,6 +150,11 @@ static unsigned int _ssl_locks_count = 0;
 # 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