diff --combined Doc/library/ssl.rst index a6ce5d6,30cb732..0000000 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@@ -366,7 -366,7 +366,7 @@@ Certificate handlin >>> import ssl >>> ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT") - 1178694000.0 + 1178668800 >>> import time >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")) 'Wed May 9 00:00:00 2007' diff --combined Lib/ssl.py index f81ef91,052a118..0000000 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@@ -852,8 -852,7 +852,8 @@@ def cert_time_to_seconds(cert_time) a Python time value in seconds past the epoch.""" import time - return time.mktime(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT")) + import calendar + return calendar.timegm(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT")) PEM_HEADER = "-----BEGIN CERTIFICATE-----" PEM_FOOTER = "-----END CERTIFICATE-----"