Skip to content

Commit 53930cb

Browse files
authored
gh-107562: make_ssl_certs.py: produce test certificates that expire far in the future by default (GH-107594)
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 <[email protected]>
1 parent 21c04e1 commit 53930cb

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Lib/test/certdata/make_ssl_certs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from subprocess import *
1010

1111
startdate = "20180829142316Z"
12-
enddate_default = "20371028142316Z"
13-
days_default = "7000"
12+
enddate_default = "25251028142316Z"
13+
days_default = "140000"
1414

1515
req_template = """
1616
[ default ]

Lib/test/test_ssl.py

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ def test_random(self):
383383
ssl.RAND_add(bytearray(b"this is a random bytearray object"), 75.0)
384384

385385
def test_parse_cert(self):
386+
self.maxDiff = None
386387
# note that this uses an 'unofficial' function in _ssl.c,
387388
# provided solely for this test, to exercise the certificate
388389
# parsing code
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Test certificates have been updated to expire far in the future. This allows
2+
testing Y2038 with system time set to after that, so that actual Y2038
3+
issues can be exposed, and not masked by expired certificate errors.

0 commit comments

Comments
 (0)