]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107562: make_ssl_certs.py: produce test certificates that expire far in the future...
authorAlexander Kanavin <alex.kanavin@gmail.com>
Wed, 9 Oct 2024 09:16:08 +0000 (11:16 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Oct 2024 09:16:08 +0000 (11:16 +0200)
This allows testing Y2038 with system time set to after that,
so that actual Y2038 issues can be exposed, and not masked
by expired certificate errors.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Lib/test/certdata/make_ssl_certs.py
Lib/test/test_ssl.py
Misc/NEWS.d/next/Tests/2023-08-03-17-26-55.gh-issue-107562.ZnbscS.rst [new file with mode: 0644]

index 198c64035c5044abe55966ca051c533dbe76b69a..18e614496385fd4aaa85549baa4d587f04be87e7 100644 (file)
@@ -9,8 +9,8 @@ import tempfile
 from subprocess import *
 
 startdate = "20180829142316Z"
-enddate_default = "20371028142316Z"
-days_default = "7000"
+enddate_default = "25251028142316Z"
+days_default = "140000"
 
 req_template = """
     [ default ]
index 216aa84a8c147b5b912392f4a14395f800a2840b..b93fa0ed99f8ce8315e67b6678c4359dca9ab569 100644 (file)
@@ -383,6 +383,7 @@ class BasicSocketTests(unittest.TestCase):
         ssl.RAND_add(bytearray(b"this is a random bytearray object"), 75.0)
 
     def test_parse_cert(self):
+        self.maxDiff = None
         # note that this uses an 'unofficial' function in _ssl.c,
         # provided solely for this test, to exercise the certificate
         # parsing code
diff --git a/Misc/NEWS.d/next/Tests/2023-08-03-17-26-55.gh-issue-107562.ZnbscS.rst b/Misc/NEWS.d/next/Tests/2023-08-03-17-26-55.gh-issue-107562.ZnbscS.rst
new file mode 100644 (file)
index 0000000..cc368d4
--- /dev/null
@@ -0,0 +1,3 @@
+Test certificates have been updated to expire far in the future. This allows
+testing Y2038 with system time set to after that, so that actual Y2038
+issues can be exposed, and not masked by expired certificate errors.