File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ def test_ciphers(self):
142142 # Error checking can happen at instantiation or when connecting
143143 with self .assertRaisesRegexp (ssl .SSLError , "No cipher can be selected" ):
144144 s = ssl .wrap_socket (socket .socket (socket .AF_INET ),
145- cert_reqs = ssl .CERT_NONE , ciphers = "^$:,;?*'dorothyx " )
145+ cert_reqs = ssl .CERT_NONE , ciphers = "xyzzy " )
146146 s .connect (remote )
147147
148148 @support .cpython_only
@@ -186,7 +186,7 @@ def test_ciphers(self):
186186 ctx .set_ciphers ("ALL" )
187187 ctx .set_ciphers ("DEFAULT" )
188188 with self .assertRaisesRegexp (ssl .SSLError , "No cipher can be selected" ):
189- ctx .set_ciphers ("^$:,;?*'dorothyx " )
189+ ctx .set_ciphers ("xyzzy " )
190190
191191 def test_verify (self ):
192192 ctx = ssl .SSLContext (ssl .PROTOCOL_TLSv1 )
Original file line number Diff line number Diff line change @@ -1462,6 +1462,10 @@ set_ciphers(PySSLContext *self, PyObject *args)
14621462 return NULL ;
14631463 ret = SSL_CTX_set_cipher_list (self -> ctx , cipherlist );
14641464 if (ret == 0 ) {
1465+ /* Clearing the error queue is necessary on some OpenSSL versions,
1466+ otherwise the error will be reported again when another SSL call
1467+ is done. */
1468+ ERR_clear_error ();
14651469 PyErr_SetString (PySSLErrorObject ,
14661470 "No cipher can be selected." );
14671471 return NULL ;
You can’t perform that action at this time.
0 commit comments