Skip to content

Commit 37ccf16

Browse files
authored
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available (GH-118425)
1 parent ca269e5 commit 37ccf16

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use a Y2038 compatible openssl time function when available.

Modules/_ssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,7 +5329,11 @@ PySSLSession_clear(PySSLSession *self)
53295329

53305330
static PyObject *
53315331
PySSLSession_get_time(PySSLSession *self, void *closure) {
5332+
#if OPENSSL_VERSION_NUMBER >= 0x30300000L
5333+
return _PyLong_FromTime_t(SSL_SESSION_get_time_ex(self->session));
5334+
#else
53325335
return PyLong_FromLong(SSL_SESSION_get_time(self->session));
5336+
#endif
53335337
}
53345338

53355339
PyDoc_STRVAR(PySSLSession_get_time_doc,

0 commit comments

Comments
 (0)