Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a5b142d

Browse files
committed
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available
1 parent 7d2ffad commit a5b142d

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)