summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/certdata/allsans.pem (renamed from Lib/test/allsans.pem)0
-rw-r--r--Lib/test/certdata/badcert.pem (renamed from Lib/test/badcert.pem)0
-rw-r--r--Lib/test/certdata/badkey.pem (renamed from Lib/test/badkey.pem)0
-rw-r--r--Lib/test/certdata/capath/4e1295a3.0 (renamed from Lib/test/capath/4e1295a3.0)0
-rw-r--r--Lib/test/certdata/capath/5ed36f99.0 (renamed from Lib/test/capath/5ed36f99.0)0
-rw-r--r--Lib/test/certdata/capath/6e88d7b8.0 (renamed from Lib/test/capath/6e88d7b8.0)0
-rw-r--r--Lib/test/certdata/capath/99d0fa06.0 (renamed from Lib/test/capath/99d0fa06.0)0
-rw-r--r--Lib/test/certdata/capath/b1930218.0 (renamed from Lib/test/capath/b1930218.0)0
-rw-r--r--Lib/test/certdata/capath/ceff1710.0 (renamed from Lib/test/capath/ceff1710.0)0
-rw-r--r--Lib/test/certdata/ffdh3072.pem (renamed from Lib/test/ffdh3072.pem)0
-rw-r--r--Lib/test/certdata/idnsans.pem (renamed from Lib/test/idnsans.pem)0
-rw-r--r--Lib/test/certdata/keycert.passwd.pem (renamed from Lib/test/keycert.passwd.pem)0
-rw-r--r--Lib/test/certdata/keycert.pem (renamed from Lib/test/keycert.pem)0
-rw-r--r--Lib/test/certdata/keycert2.pem (renamed from Lib/test/keycert2.pem)0
-rw-r--r--Lib/test/certdata/keycert3.pem (renamed from Lib/test/keycert3.pem)0
-rw-r--r--Lib/test/certdata/keycert4.pem (renamed from Lib/test/keycert4.pem)0
-rw-r--r--Lib/test/certdata/keycertecc.pem (renamed from Lib/test/keycertecc.pem)0
-rw-r--r--Lib/test/certdata/make_ssl_certs.py (renamed from Lib/test/make_ssl_certs.py)0
-rw-r--r--Lib/test/certdata/nokia.pem (renamed from Lib/test/nokia.pem)0
-rw-r--r--Lib/test/certdata/nosan.pem (renamed from Lib/test/nosan.pem)0
-rw-r--r--Lib/test/certdata/nullbytecert.pem (renamed from Lib/test/nullbytecert.pem)0
-rw-r--r--Lib/test/certdata/nullcert.pem (renamed from Lib/test/nullcert.pem)0
-rw-r--r--Lib/test/certdata/pycacert.pem (renamed from Lib/test/pycacert.pem)0
-rw-r--r--Lib/test/certdata/pycakey.pem (renamed from Lib/test/pycakey.pem)0
-rw-r--r--Lib/test/certdata/revocation.crl (renamed from Lib/test/revocation.crl)0
-rw-r--r--Lib/test/certdata/secp384r1.pem (renamed from Lib/test/secp384r1.pem)0
-rw-r--r--Lib/test/certdata/selfsigned_pythontestdotnet.pem (renamed from Lib/test/selfsigned_pythontestdotnet.pem)0
-rw-r--r--Lib/test/certdata/ssl_cert.pem (renamed from Lib/test/ssl_cert.pem)0
-rw-r--r--Lib/test/certdata/ssl_key.passwd.pem (renamed from Lib/test/ssl_key.passwd.pem)0
-rw-r--r--Lib/test/certdata/ssl_key.pem (renamed from Lib/test/ssl_key.pem)0
-rw-r--r--Lib/test/certdata/talos-2019-0758.pem (renamed from Lib/test/talos-2019-0758.pem)0
-rw-r--r--Lib/test/ssl_servers.py2
-rw-r--r--Lib/test/test_asyncio/utils.py16
-rw-r--r--Lib/test/test_ftplib.py4
-rw-r--r--Lib/test/test_httplib.py8
-rw-r--r--Lib/test/test_imaplib.py4
-rw-r--r--Lib/test/test_logging.py2
-rw-r--r--Lib/test/test_nntplib.py2
-rw-r--r--Lib/test/test_poplib.py4
-rw-r--r--Lib/test/test_ssl.py12
-rw-r--r--Lib/test/test_urllib2_localnet.py4
41 files changed, 30 insertions, 28 deletions
diff --git a/Lib/test/allsans.pem b/Lib/test/certdata/allsans.pem
index e400e17..e400e17 100644
--- a/Lib/test/allsans.pem
+++ b/Lib/test/certdata/allsans.pem
diff --git a/Lib/test/badcert.pem b/Lib/test/certdata/badcert.pem
index c419146..c419146 100644
--- a/Lib/test/badcert.pem
+++ b/Lib/test/certdata/badcert.pem
diff --git a/Lib/test/badkey.pem b/Lib/test/certdata/badkey.pem
index 1c8a955..1c8a955 100644
--- a/Lib/test/badkey.pem
+++ b/Lib/test/certdata/badkey.pem
diff --git a/Lib/test/capath/4e1295a3.0 b/Lib/test/certdata/capath/4e1295a3.0
index 9d7ac23..9d7ac23 100644
--- a/Lib/test/capath/4e1295a3.0
+++ b/Lib/test/certdata/capath/4e1295a3.0
diff --git a/Lib/test/capath/5ed36f99.0 b/Lib/test/certdata/capath/5ed36f99.0
index e7dfc82..e7dfc82 100644
--- a/Lib/test/capath/5ed36f99.0
+++ b/Lib/test/certdata/capath/5ed36f99.0
diff --git a/Lib/test/capath/6e88d7b8.0 b/Lib/test/certdata/capath/6e88d7b8.0
index 9d7ac23..9d7ac23 100644
--- a/Lib/test/capath/6e88d7b8.0
+++ b/Lib/test/certdata/capath/6e88d7b8.0
diff --git a/Lib/test/capath/99d0fa06.0 b/Lib/test/certdata/capath/99d0fa06.0
index e7dfc82..e7dfc82 100644
--- a/Lib/test/capath/99d0fa06.0
+++ b/Lib/test/certdata/capath/99d0fa06.0
diff --git a/Lib/test/capath/b1930218.0 b/Lib/test/certdata/capath/b1930218.0
index 941d791..941d791 100644
--- a/Lib/test/capath/b1930218.0
+++ b/Lib/test/certdata/capath/b1930218.0
diff --git a/Lib/test/capath/ceff1710.0 b/Lib/test/certdata/capath/ceff1710.0
index 941d791..941d791 100644
--- a/Lib/test/capath/ceff1710.0
+++ b/Lib/test/certdata/capath/ceff1710.0
diff --git a/Lib/test/ffdh3072.pem b/Lib/test/certdata/ffdh3072.pem
index ad69bac..ad69bac 100644
--- a/Lib/test/ffdh3072.pem
+++ b/Lib/test/certdata/ffdh3072.pem
diff --git a/Lib/test/idnsans.pem b/Lib/test/certdata/idnsans.pem
index cbcac78..cbcac78 100644
--- a/Lib/test/idnsans.pem
+++ b/Lib/test/certdata/idnsans.pem
diff --git a/Lib/test/keycert.passwd.pem b/Lib/test/certdata/keycert.passwd.pem
index c330c36..c330c36 100644
--- a/Lib/test/keycert.passwd.pem
+++ b/Lib/test/certdata/keycert.passwd.pem
diff --git a/Lib/test/keycert.pem b/Lib/test/certdata/keycert.pem
index 0d39863..0d39863 100644
--- a/Lib/test/keycert.pem
+++ b/Lib/test/certdata/keycert.pem
diff --git a/Lib/test/keycert2.pem b/Lib/test/certdata/keycert2.pem
index e59d454..e59d454 100644
--- a/Lib/test/keycert2.pem
+++ b/Lib/test/certdata/keycert2.pem
diff --git a/Lib/test/keycert3.pem b/Lib/test/certdata/keycert3.pem
index f6887ba..f6887ba 100644
--- a/Lib/test/keycert3.pem
+++ b/Lib/test/certdata/keycert3.pem
diff --git a/Lib/test/keycert4.pem b/Lib/test/certdata/keycert4.pem
index 1003d67..1003d67 100644
--- a/Lib/test/keycert4.pem
+++ b/Lib/test/certdata/keycert4.pem
diff --git a/Lib/test/keycertecc.pem b/Lib/test/certdata/keycertecc.pem
index 81daa4c..81daa4c 100644
--- a/Lib/test/keycertecc.pem
+++ b/Lib/test/certdata/keycertecc.pem
diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/certdata/make_ssl_certs.py
index 94a35a6..94a35a6 100644
--- a/Lib/test/make_ssl_certs.py
+++ b/Lib/test/certdata/make_ssl_certs.py
diff --git a/Lib/test/nokia.pem b/Lib/test/certdata/nokia.pem
index 0d044df..0d044df 100644
--- a/Lib/test/nokia.pem
+++ b/Lib/test/certdata/nokia.pem
diff --git a/Lib/test/nosan.pem b/Lib/test/certdata/nosan.pem
index ec10cdc..ec10cdc 100644
--- a/Lib/test/nosan.pem
+++ b/Lib/test/certdata/nosan.pem
diff --git a/Lib/test/nullbytecert.pem b/Lib/test/certdata/nullbytecert.pem
index 447186c..447186c 100644
--- a/Lib/test/nullbytecert.pem
+++ b/Lib/test/certdata/nullbytecert.pem
diff --git a/Lib/test/nullcert.pem b/Lib/test/certdata/nullcert.pem
index e69de29..e69de29 100644
--- a/Lib/test/nullcert.pem
+++ b/Lib/test/certdata/nullcert.pem
diff --git a/Lib/test/pycacert.pem b/Lib/test/certdata/pycacert.pem
index 360cd57..360cd57 100644
--- a/Lib/test/pycacert.pem
+++ b/Lib/test/certdata/pycacert.pem
diff --git a/Lib/test/pycakey.pem b/Lib/test/certdata/pycakey.pem
index 819bdef..819bdef 100644
--- a/Lib/test/pycakey.pem
+++ b/Lib/test/certdata/pycakey.pem
diff --git a/Lib/test/revocation.crl b/Lib/test/certdata/revocation.crl
index 621675e..621675e 100644
--- a/Lib/test/revocation.crl
+++ b/Lib/test/certdata/revocation.crl
diff --git a/Lib/test/secp384r1.pem b/Lib/test/certdata/secp384r1.pem
index eef7117..eef7117 100644
--- a/Lib/test/secp384r1.pem
+++ b/Lib/test/certdata/secp384r1.pem
diff --git a/Lib/test/selfsigned_pythontestdotnet.pem b/Lib/test/certdata/selfsigned_pythontestdotnet.pem
index 2b17607..2b17607 100644
--- a/Lib/test/selfsigned_pythontestdotnet.pem
+++ b/Lib/test/certdata/selfsigned_pythontestdotnet.pem
diff --git a/Lib/test/ssl_cert.pem b/Lib/test/certdata/ssl_cert.pem
index de59671..de59671 100644
--- a/Lib/test/ssl_cert.pem
+++ b/Lib/test/certdata/ssl_cert.pem
diff --git a/Lib/test/ssl_key.passwd.pem b/Lib/test/certdata/ssl_key.passwd.pem
index 46de61a..46de61a 100644
--- a/Lib/test/ssl_key.passwd.pem
+++ b/Lib/test/certdata/ssl_key.passwd.pem
diff --git a/Lib/test/ssl_key.pem b/Lib/test/certdata/ssl_key.pem
index 1ea4578..1ea4578 100644
--- a/Lib/test/ssl_key.pem
+++ b/Lib/test/certdata/ssl_key.pem
diff --git a/Lib/test/talos-2019-0758.pem b/Lib/test/certdata/talos-2019-0758.pem
index 13b95a7..13b95a7 100644
--- a/Lib/test/talos-2019-0758.pem
+++ b/Lib/test/certdata/talos-2019-0758.pem
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index a4bd745..15b071e 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -14,7 +14,7 @@ from test.support import socket_helper
here = os.path.dirname(__file__)
HOST = socket_helper.HOST
-CERTFILE = os.path.join(here, 'keycert.pem')
+CERTFILE = os.path.join(here, 'certdata', 'keycert.pem')
# This one's based on HTTPServer, which is based on socketserver
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py
index 19de854..f49db4e 100644
--- a/Lib/test/test_asyncio/utils.py
+++ b/Lib/test/test_asyncio/utils.py
@@ -43,21 +43,21 @@ from test.support import threading_helper
CLOCK_RES = 0.020
-def data_file(filename):
+def data_file(*filename):
if hasattr(support, 'TEST_HOME_DIR'):
- fullname = os.path.join(support.TEST_HOME_DIR, filename)
+ fullname = os.path.join(support.TEST_HOME_DIR, *filename)
if os.path.isfile(fullname):
return fullname
- fullname = os.path.join(os.path.dirname(__file__), '..', filename)
+ fullname = os.path.join(os.path.dirname(__file__), '..', *filename)
if os.path.isfile(fullname):
return fullname
- raise FileNotFoundError(filename)
+ raise FileNotFoundError(os.path.join(filename))
-ONLYCERT = data_file('ssl_cert.pem')
-ONLYKEY = data_file('ssl_key.pem')
-SIGNED_CERTFILE = data_file('keycert3.pem')
-SIGNING_CA = data_file('pycacert.pem')
+ONLYCERT = data_file('certdata', 'ssl_cert.pem')
+ONLYKEY = data_file('certdata', 'ssl_key.pem')
+SIGNED_CERTFILE = data_file('certdata', 'keycert3.pem')
+SIGNING_CA = data_file('certdata', 'pycacert.pem')
PEERCERT = {
'OCSP': ('http://testca.pythontest.net/testca/ocsp/',),
'caIssuers': ('http://testca.pythontest.net/testca/pycacert.cer',),
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 7d6b12f..a90a53f 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -327,8 +327,8 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
if ssl is not None:
- CERTFILE = os.path.join(os.path.dirname(__file__), "keycert3.pem")
- CAFILE = os.path.join(os.path.dirname(__file__), "pycacert.pem")
+ CERTFILE = os.path.join(os.path.dirname(__file__), "certdata", "keycert3.pem")
+ CAFILE = os.path.join(os.path.dirname(__file__), "certdata", "pycacert.pem")
class SSLConnection(asyncore.dispatcher):
"""An asyncore.dispatcher subclass supporting TLS/SSL."""
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 47dbf08..f6a9c82 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -23,11 +23,13 @@ support.requires_working_socket(module=True)
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
-CERT_localhost = os.path.join(here, 'keycert.pem')
+CERT_localhost = os.path.join(here, 'certdata', 'keycert.pem')
# Self-signed cert file for 'fakehostname'
-CERT_fakehostname = os.path.join(here, 'keycert2.pem')
+CERT_fakehostname = os.path.join(here, 'certdata', 'keycert2.pem')
# Self-signed cert file for self-signed.pythontest.net
-CERT_selfsigned_pythontestdotnet = os.path.join(here, 'selfsigned_pythontestdotnet.pem')
+CERT_selfsigned_pythontestdotnet = os.path.join(
+ here, 'certdata', 'selfsigned_pythontestdotnet.pem',
+)
# constants for testing chunked encoding
chunked_start = (
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index f097ba6..bd0fc9c 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -26,8 +26,8 @@ except ImportError:
support.requires_working_socket(module=True)
-CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")
-CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem")
+CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "certdata", "keycert3.pem")
+CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "certdata", "pycacert.pem")
class TestImaplib(unittest.TestCase):
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 55c5cd5..ccf479d 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -2075,7 +2075,7 @@ class HTTPHandlerTest(BaseTest):
sslctx = None
else:
here = os.path.dirname(__file__)
- localhost_cert = os.path.join(here, "keycert.pem")
+ localhost_cert = os.path.join(here, "certdata", "keycert.pem")
sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
sslctx.load_cert_chain(localhost_cert)
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index 31a02f8..30ae557 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -20,7 +20,7 @@ except ImportError:
ssl = None
-certfile = os.path.join(os.path.dirname(__file__), 'keycert3.pem')
+certfile = os.path.join(os.path.dirname(__file__), 'certdata', 'keycert3.pem')
if ssl is not None:
SSLError = ssl.SSLError
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 5ad9202..49ba993 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -32,8 +32,8 @@ if hasattr(poplib, 'POP3_SSL'):
import ssl
SUPPORTS_SSL = True
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")
- CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem")
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "certdata", "keycert3.pem")
+ CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "certdata", "pycacert.pem")
requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 1bfec23..c98f767 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -63,10 +63,10 @@ for proto, ver in (
PROTOCOL_TO_TLS_VERSION[proto] = ver
def data_file(*name):
- return os.path.join(os.path.dirname(__file__), *name)
+ return os.path.join(os.path.dirname(__file__), "certdata", *name)
# The custom key and certificate files used in test_ssl are generated
-# using Lib/test/make_ssl_certs.py.
+# using Lib/test/certdata/make_ssl_certs.py.
# Other certificates are simply fetched from the internet servers they
# are meant to authenticate.
@@ -675,7 +675,7 @@ class BasicSocketTests(unittest.TestCase):
def bad_cert_test(self, certfile):
"""Check that trying to use the given client certificate fails"""
certfile = os.path.join(os.path.dirname(__file__) or os.curdir,
- certfile)
+ "certdata", certfile)
sock = socket.socket()
self.addCleanup(sock.close)
with self.assertRaises(ssl.SSLError):
@@ -3557,12 +3557,12 @@ class ThreadedTests(unittest.TestCase):
# try to connect
if support.verbose:
sys.stdout.write('\n')
- with open(CERTFILE, 'rb') as f:
+ # Get this test file itself:
+ with open(__file__, 'rb') as f:
d1 = f.read()
d2 = ''
# now fetch the same data from the HTTPS server
- url = 'https://localhost:%d/%s' % (
- server.port, os.path.split(CERTFILE)[1])
+ url = f'https://localhost:{server.port}/test_ssl.py'
context = ssl.create_default_context(cafile=SIGNING_CA)
f = urllib.request.urlopen(url, context=context)
try:
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index f472935..96e4397 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -22,9 +22,9 @@ support.requires_working_socket(module=True)
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
-CERT_localhost = os.path.join(here, 'keycert.pem')
+CERT_localhost = os.path.join(here, 'certdata', 'keycert.pem')
# Self-signed cert file for 'fakehostname'
-CERT_fakehostname = os.path.join(here, 'keycert2.pem')
+CERT_fakehostname = os.path.join(here, 'certdata', 'keycert2.pem')
# Loopback http server infrastructure