mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.11] [3.12] gh-108303: Move all certificates to Lib/test/certdata/
(GH-109489) (GH-109682) (#110646)
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (GH-109682) * gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (cherry picked from commite57ecf6bbc
) Python 3.12 backport: update also `test_nntplib`. (cherry picked from commitc2d542b42c
) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: T. Wouters <thomas@python.org>
This commit is contained in:
parent
4b67878daa
commit
28c6cc1928
42 changed files with 32 additions and 29 deletions
|
@ -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',),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue