@@ -784,12 +784,12 @@ def test_ciphers(self):
784784 @skip_if_broken_ubuntu_ssl
785785 def test_options (self ):
786786 ctx = ssl .SSLContext (ssl .PROTOCOL_TLSv1 )
787- # OP_ALL | OP_NO_SSLv2 is the default value
788- self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 ,
789- ctx .options )
790- ctx .options |= ssl .OP_NO_SSLv3
787+ # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
791788 self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 | ssl .OP_NO_SSLv3 ,
792789 ctx .options )
790+ ctx .options |= ssl .OP_NO_TLSv1
791+ self .assertEqual (ssl .OP_ALL | ssl .OP_NO_SSLv2 | ssl .OP_NO_SSLv3 | ssl .OP_NO_TLSv1 ,
792+ ctx .options )
793793 if can_clear_options ():
794794 ctx .options = (ctx .options & ~ ssl .OP_NO_SSLv2 ) | ssl .OP_NO_TLSv1
795795 self .assertEqual (ssl .OP_ALL | ssl .OP_NO_TLSv1 | ssl .OP_NO_SSLv3 ,
@@ -2451,17 +2451,17 @@ def test_protocol_sslv23(self):
24512451 " SSL2 client to SSL23 server test unexpectedly failed:\n %s\n "
24522452 % str (x ))
24532453 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2454- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , 'SSLv3' )
2454+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False )
24552455 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True )
24562456 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , 'TLSv1' )
24572457
24582458 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2459- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , 'SSLv3' , ssl .CERT_OPTIONAL )
2459+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_OPTIONAL )
24602460 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True , ssl .CERT_OPTIONAL )
24612461 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_OPTIONAL )
24622462
24632463 if hasattr (ssl , 'PROTOCOL_SSLv3' ):
2464- try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , 'SSLv3' , ssl .CERT_REQUIRED )
2464+ try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_REQUIRED )
24652465 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_SSLv23 , True , ssl .CERT_REQUIRED )
24662466 try_protocol_combo (ssl .PROTOCOL_SSLv23 , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_REQUIRED )
24672467
@@ -2493,8 +2493,8 @@ def test_protocol_sslv3(self):
24932493 try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_TLSv1 , False )
24942494 if no_sslv2_implies_sslv3_hello ():
24952495 # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
2496- try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv23 , 'SSLv3' ,
2497- client_options = ssl .OP_NO_SSLv2 )
2496+ try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv23 ,
2497+ False , client_options = ssl .OP_NO_SSLv2 )
24982498
24992499 @skip_if_broken_ubuntu_ssl
25002500 def test_protocol_tlsv1 (self ):
0 commit comments