This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/main by this push:
     new 8f0eb5cbf Fix remaining deprecation warning when compiling against 
OpenSSL 3.5.x
8f0eb5cbf is described below

commit 8f0eb5cbffe1882f095cf98086216aff7bf41cbc
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Feb 5 15:52:04 2026 +0000

    Fix remaining deprecation warning when compiling against OpenSSL 3.5.x
---
 native/src/ssl.c                  | 6 +++++-
 xdocs/miscellaneous/changelog.xml | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/native/src/ssl.c b/native/src/ssl.c
index 4b8d7fd43..232faa1f0 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -990,7 +990,11 @@ TCN_IMPLEMENT_CALL(jlong, SSL, getTime)(TCN_STDARGS, jlong 
ssl)
 
     session  = SSL_get_session(ssl_);
     if (session) {
-        return SSL_get_time(session);
+#if (OPENSSL_VERSION_NUMBER > 0x302FFFFFL)
+        return SSL_SESSION_get_time_ex(session);
+#else
+        return SSL_SESSION_get_time(session);
+#endif
     } else {
         tcn_ThrowException(e, "ssl session is null");
         return 0;
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 3c875e466..f84d7440a 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -70,6 +70,12 @@
       Refactor extraction of ECDH curve name from the Certificate to avoid
       deprecated OpenSSL methods. (markt)
     </fix>
+    <fix>
+      Refactor the native implementation of <code>SSL.getTime()</code> to avoid
+      the Y2038 problem in <code>SSL_SESSION_get_time()</code> when running on 
a
+      verion of OpenSSL that includes the new
+      <code>SSL_SESSION_get_time_ex()</code> method. (markt)
+    </fix>
   </changelog>
 </section>
 <section name="2.0.12" rtext="2026-01-12">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to