@@ -971,7 +971,7 @@ def test_cert_store_stats(self):
971
971
ctx .load_verify_locations (CERTFILE )
972
972
self .assertEqual (ctx .cert_store_stats (),
973
973
{'x509_ca' : 0 , 'crl' : 0 , 'x509' : 1 })
974
- ctx .load_verify_locations (SVN_PYTHON_ORG_ROOT_CERT )
974
+ ctx .load_verify_locations (CAFILE_CACERT )
975
975
self .assertEqual (ctx .cert_store_stats (),
976
976
{'x509_ca' : 1 , 'crl' : 0 , 'x509' : 2 })
977
977
@@ -981,8 +981,8 @@ def test_get_ca_certs(self):
981
981
# CERTFILE is not flagged as X509v3 Basic Constraints: CA:TRUE
982
982
ctx .load_verify_locations (CERTFILE )
983
983
self .assertEqual (ctx .get_ca_certs (), [])
984
- # but SVN_PYTHON_ORG_ROOT_CERT is a CA cert
985
- ctx .load_verify_locations (SVN_PYTHON_ORG_ROOT_CERT )
984
+ # but CAFILE_CACERT is a CA cert
985
+ ctx .load_verify_locations (CAFILE_CACERT )
986
986
self .assertEqual (ctx .get_ca_certs (),
987
987
[{'issuer' : ((('organizationName' , 'Root CA' ),),
988
988
(('organizationalUnitName' , 'http://www.cacert.org' ),),
@@ -998,7 +998,7 @@ def test_get_ca_certs(self):
998
998
((
'emailAddress' ,
'[email protected] ' ),)),
999
999
'version' : 3 }])
1000
1000
1001
- with open (SVN_PYTHON_ORG_ROOT_CERT ) as f :
1001
+ with open (CAFILE_CACERT ) as f :
1002
1002
pem = f .read ()
1003
1003
der = ssl .PEM_cert_to_DER_cert (pem )
1004
1004
self .assertEqual (ctx .get_ca_certs (True ), [der ])
@@ -1335,15 +1335,15 @@ def test_connect_capath(self):
1335
1335
s .close ()
1336
1336
1337
1337
def test_connect_cadata (self ):
1338
- with open (CAFILE_CACERT ) as f :
1338
+ with open (REMOTE_ROOT_CERT ) as f :
1339
1339
pem = f .read ()
1340
1340
der = ssl .PEM_cert_to_DER_cert (pem )
1341
- with support .transient_internet ("svn.python.org" ):
1341
+ with support .transient_internet (REMOTE_HOST ):
1342
1342
ctx = ssl .SSLContext (ssl .PROTOCOL_SSLv23 )
1343
1343
ctx .verify_mode = ssl .CERT_REQUIRED
1344
1344
ctx .load_verify_locations (cadata = pem )
1345
1345
with ctx .wrap_socket (socket .socket (socket .AF_INET )) as s :
1346
- s .connect (("svn.python.org" , 443 ))
1346
+ s .connect ((REMOTE_HOST , 443 ))
1347
1347
cert = s .getpeercert ()
1348
1348
self .assertTrue (cert )
1349
1349
@@ -1352,7 +1352,7 @@ def test_connect_cadata(self):
1352
1352
ctx .verify_mode = ssl .CERT_REQUIRED
1353
1353
ctx .load_verify_locations (cadata = der )
1354
1354
with ctx .wrap_socket (socket .socket (socket .AF_INET )) as s :
1355
- s .connect (("svn.python.org" , 443 ))
1355
+ s .connect ((REMOTE_HOST , 443 ))
1356
1356
cert = s .getpeercert ()
1357
1357
self .assertTrue (cert )
1358
1358
@@ -1475,13 +1475,13 @@ def test_algorithms(self):
1475
1475
1476
1476
def test_get_ca_certs_capath (self ):
1477
1477
# capath certs are loaded on request
1478
- with support .transient_internet ("svn.python.org" ):
1478
+ with support .transient_internet (REMOTE_HOST ):
1479
1479
ctx = ssl .SSLContext (ssl .PROTOCOL_SSLv23 )
1480
1480
ctx .verify_mode = ssl .CERT_REQUIRED
1481
1481
ctx .load_verify_locations (capath = CAPATH )
1482
1482
self .assertEqual (ctx .get_ca_certs (), [])
1483
1483
s = ctx .wrap_socket (socket .socket (socket .AF_INET ))
1484
- s .connect (("svn.python.org" , 443 ))
1484
+ s .connect ((REMOTE_HOST , 443 ))
1485
1485
try :
1486
1486
cert = s .getpeercert ()
1487
1487
self .assertTrue (cert )
@@ -1492,12 +1492,12 @@ def test_get_ca_certs_capath(self):
1492
1492
@needs_sni
1493
1493
def test_context_setget (self ):
1494
1494
# Check that the context of a connected socket can be replaced.
1495
- with support .transient_internet ("svn.python.org" ):
1495
+ with support .transient_internet (REMOTE_HOST ):
1496
1496
ctx1 = ssl .SSLContext (ssl .PROTOCOL_TLSv1 )
1497
1497
ctx2 = ssl .SSLContext (ssl .PROTOCOL_SSLv23 )
1498
1498
s = socket .socket (socket .AF_INET )
1499
1499
with ctx1 .wrap_socket (s ) as ss :
1500
- ss .connect (("svn.python.org" , 443 ))
1500
+ ss .connect ((REMOTE_HOST , 443 ))
1501
1501
self .assertIs (ss .context , ctx1 )
1502
1502
self .assertIs (ss ._sslobj .context , ctx1 )
1503
1503
ss .context = ctx2
0 commit comments