@@ -674,12 +674,12 @@ def test_ciphers(self):
674674 @skip_if_broken_ubuntu_ssl
675675 def test_options (self ):
676676 ctx = ssl .SSLContext (ssl .PROTOCOL_TLSv1 )
677- # OP_ALL | OP_NO_SSLv2 is the default value
678- self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 ,
679- ctx .options )
680- ctx .options |= ssl .OP_NO_SSLv3
677+ # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
681678 self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 | ssl .OP_NO_SSLv3 ,
682679 ctx .options )
680+ ctx .options |= ssl .OP_NO_TLSv1
681+ self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 | ssl .OP_NO_SSLv3 | ssl .OP_NO_TLSv1 ,
682+ ctx .options )
683683 if can_clear_options ():
684684 ctx .options = (ctx .options & ~ ssl .OP_NO_SSLv2 ) | ssl .OP_NO_TLSv1
685685 self .assertEqual (ssl .OP_ALL | ssl .OP_NO_TLSv1 | ssl .OP_NO_SSLv3 ,
@@ -2172,17 +2172,17 @@ def test_protocol_sslv23(self):
21722172 " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n "
21732173 % str (x ))
21742174 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2175- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , True )
2175+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False )
21762176 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True )
21772177 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , True )
21782178
21792179 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2180- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , True , ssl .CERT_OPTIONAL )
2180+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_OPTIONAL )
21812181 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True , ssl .CERT_OPTIONAL )
21822182 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , True , ssl .CERT_OPTIONAL )
21832183
21842184 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2185- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , True , ssl .CERT_REQUIRED )
2185+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_REQUIRED )
21862186 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True , ssl .CERT_REQUIRED )
21872187 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , True , ssl .CERT_REQUIRED )
21882188
@@ -2214,8 +2214,8 @@ def test_protocol_sslv3(self):
22142214 try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_TLSv1 , False )
22152215 if no_sslv2_implies_sslv3_hello ():
22162216 # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
2217- try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv23 , True ,
2218- client_options = ssl .OP_NO_SSLv2 )
2217+ try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv23 ,
2218+ False , client_options = ssl .OP_NO_SSLv2 )
22192219
22202220 @skip_if_broken_ubuntu_ssl
22212221 def test_protocol_tlsv1 (self ):
0 commit comments