@@ -38,7 +38,7 @@ def test02_open_fails(self):
3838 self .assertRaises (socket .error , conn .connect )
3939
4040 def test03_ssl_verification_of_peer_fails (self ):
41- ctx = SSL .Context (SSL .TLSv1_METHOD )
41+ ctx = SSL .Context (SSL .TLSv1_2_METHOD )
4242
4343 def verify_callback (conn , x509 , errnum , errdepth , preverify_ok ):
4444 log .debug ('SSL peer certificate verification failed for %r' ,
@@ -57,7 +57,7 @@ def verify_callback(conn, x509, errnum, errdepth, preverify_ok):
5757 self .assertRaises (SSL .Error , conn .request , 'GET' , '/' )
5858
5959 def test03_ssl_verification_of_peer_succeeds (self ):
60- ctx = SSL .Context (SSL .TLSv1_METHOD )
60+ ctx = SSL .Context (SSL .TLSv1_2_METHOD )
6161
6262 verify_callback = lambda conn , x509 , errnum , errdepth , preverify_ok : \
6363 preverify_ok
@@ -76,7 +76,7 @@ def test03_ssl_verification_of_peer_succeeds(self):
7676 print ('Response = %s' % resp .read ())
7777
7878 def test04_ssl_verification_with_subj_alt_name (self ):
79- ctx = SSL .Context (SSL .TLSv1_METHOD )
79+ ctx = SSL .Context (SSL .TLSv1_2_METHOD )
8080
8181 verification = ServerSSLCertVerification (hostname = 'localhost' )
8282 verify_callback = verification .get_verify_server_cert_func ()
@@ -95,7 +95,7 @@ def test04_ssl_verification_with_subj_alt_name(self):
9595 print ('Response = %s' % resp .read ())
9696
9797 def test04_ssl_verification_with_subj_common_name (self ):
98- ctx = SSL .Context (SSL .TLSv1_METHOD )
98+ ctx = SSL .Context (SSL .TLSv1_2_METHOD )
9999
100100 # Explicitly set verification of peer hostname using peer certificate
101101 # subject common name
0 commit comments