summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-05-03 13:34:05 (GMT)
committerGitHub <noreply@github.com>2024-05-03 13:34:05 (GMT)
commit37ccf167869d101c4021c435868b7f89ccda8148 (patch)
tree74910d5c5a1d736dba81ad932999812b215d4d7a /Modules/_ssl.c
parentca269e58c290be8ca11bb728004ea842d9f85e3a (diff)
downloadcpython-37ccf167869d101c4021c435868b7f89ccda8148.zip
cpython-37ccf167869d101c4021c435868b7f89ccda8148.tar.gz
cpython-37ccf167869d101c4021c435868b7f89ccda8148.tar.bz2
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available (GH-118425)
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index f7fdbf4..885a9c2 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,