Skip to content

Commit 0b799fd

Browse files
committed
[fix] Java's default session timeout in 24h
1 parent f957572 commit 0b799fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/jruby/ext/openssl/SSLSession.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ public IRubyObject set_time(final ThreadContext context, IRubyObject time) {
142142
@JRubyMethod(name = "timeout")
143143
public IRubyObject timeout(final ThreadContext context) {
144144
final SSLSessionContext sessionContext = sslSession().getSessionContext();
145-
// default in OpenSSL is 300
146-
if ( sessionContext == null ) return context.runtime.newFixnum(300);
145+
if (sessionContext == null) {
146+
// JDK's default is 24h (default in OpenSSL is 300)
147+
return context.runtime.newFixnum(86400);
148+
}
147149
return context.runtime.newFixnum(sessionContext.getSessionTimeout());
148150
}
149151

0 commit comments

Comments
 (0)