https://github.com/python/cpython/commit/37ccf167869d101c4021c435868b7f89ccda8148
commit: 37ccf167869d101c4021c435868b7f89ccda8148
branch: main
author: Alexander Kanavin <[email protected]>
committer: encukou <[email protected]>
date: 2024-05-03T15:34:05+02:00
summary:

gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available 
(GH-118425)

files:
A Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst
M Modules/_ssl.c

diff --git 
a/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst 
b/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst
new file mode 100644
index 00000000000000..354dfc46362062
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst
@@ -0,0 +1 @@
+Use a Y2038 compatible openssl time function when available.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index f7fdbf4b6f90cb..885a9c25967d2d 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -5329,7 +5329,11 @@ PySSLSession_clear(PySSLSession *self)
 
 static PyObject *
 PySSLSession_get_time(PySSLSession *self, void *closure) {
+#if OPENSSL_VERSION_NUMBER >= 0x30300000L
+    return _PyLong_FromTime_t(SSL_SESSION_get_time_ex(self->session));
+#else
     return PyLong_FromLong(SSL_SESSION_get_time(self->session));
+#endif
 }
 
 PyDoc_STRVAR(PySSLSession_get_time_doc,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to