Skip to content

Commit 8f0eb5c

Browse files
committed
Fix remaining deprecation warning when compiling against OpenSSL 3.5.x
1 parent 44736df commit 8f0eb5c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

native/src/ssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,11 @@ TCN_IMPLEMENT_CALL(jlong, SSL, getTime)(TCN_STDARGS, jlong ssl)
990990

991991
session = SSL_get_session(ssl_);
992992
if (session) {
993-
return SSL_get_time(session);
993+
#if (OPENSSL_VERSION_NUMBER > 0x302FFFFFL)
994+
return SSL_SESSION_get_time_ex(session);
995+
#else
996+
return SSL_SESSION_get_time(session);
997+
#endif
994998
} else {
995999
tcn_ThrowException(e, "ssl session is null");
9961000
return 0;

xdocs/miscellaneous/changelog.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
Refactor extraction of ECDH curve name from the Certificate to avoid
7171
deprecated OpenSSL methods. (markt)
7272
</fix>
73+
<fix>
74+
Refactor the native implementation of <code>SSL.getTime()</code> to avoid
75+
the Y2038 problem in <code>SSL_SESSION_get_time()</code> when running on a
76+
verion of OpenSSL that includes the new
77+
<code>SSL_SESSION_get_time_ex()</code> method. (markt)
78+
</fix>
7379
</changelog>
7480
</section>
7581
<section name="2.0.12" rtext="2026-01-12">

0 commit comments

Comments
 (0)