From 0b799fd29031398aa934cb5e2bcf0b4736462c0a Mon Sep 17 00:00:00 2001 From: kares Date: Fri, 1 Jul 2022 13:21:47 +0200 Subject: [PATCH] [fix] Java's default session timeout in 24h --- src/main/java/org/jruby/ext/openssl/SSLSession.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jruby/ext/openssl/SSLSession.java b/src/main/java/org/jruby/ext/openssl/SSLSession.java index edea2ad0..5c2a832a 100644 --- a/src/main/java/org/jruby/ext/openssl/SSLSession.java +++ b/src/main/java/org/jruby/ext/openssl/SSLSession.java @@ -142,8 +142,10 @@ public IRubyObject set_time(final ThreadContext context, IRubyObject time) { @JRubyMethod(name = "timeout") public IRubyObject timeout(final ThreadContext context) { final SSLSessionContext sessionContext = sslSession().getSessionContext(); - // default in OpenSSL is 300 - if ( sessionContext == null ) return context.runtime.newFixnum(300); + if (sessionContext == null) { + // JDK's default is 24h (default in OpenSSL is 300) + return context.runtime.newFixnum(86400); + } return context.runtime.newFixnum(sessionContext.getSessionTimeout()); }