[Python-checkins] r81235 - in python/branches/py3k: Lib/test/test_ssl.py Modules/_ssl.c

antoine.pitrou python-checkins at python.org
Sun May 16 21:56:32 CEST 2010


Author: antoine.pitrou
Date: Sun May 16 21:56:32 2010
New Revision: 81235

Log:
Fix (hopefully) the remaining test_ssl buildbot failures



Modified:
   python/branches/py3k/Lib/test/test_ssl.py
   python/branches/py3k/Modules/_ssl.c

Modified: python/branches/py3k/Lib/test/test_ssl.py
==============================================================================
--- python/branches/py3k/Lib/test/test_ssl.py	(original)
+++ python/branches/py3k/Lib/test/test_ssl.py	Sun May 16 21:56:32 2010
@@ -142,7 +142,7 @@
         # Error checking can happen at instantiation or when connecting
         with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
             s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-                                cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
+                                cert_reqs=ssl.CERT_NONE, ciphers="xyzzy")
             s.connect(remote)
 
     @support.cpython_only
@@ -186,7 +186,7 @@
         ctx.set_ciphers("ALL")
         ctx.set_ciphers("DEFAULT")
         with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
-            ctx.set_ciphers("^$:,;?*'dorothyx")
+            ctx.set_ciphers("xyzzy")
 
     def test_verify(self):
         ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

Modified: python/branches/py3k/Modules/_ssl.c
==============================================================================
--- python/branches/py3k/Modules/_ssl.c	(original)
+++ python/branches/py3k/Modules/_ssl.c	Sun May 16 21:56:32 2010
@@ -1462,6 +1462,10 @@
         return NULL;
     ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
     if (ret == 0) {
+        /* Clearing the error queue is necessary on some OpenSSL versions,
+           otherwise the error will be reported again when another SSL call
+           is done. */
+        ERR_clear_error();
         PyErr_SetString(PySSLErrorObject,
                         "No cipher can be selected.");
         return NULL;


More information about the Python-checkins mailing list