Skip to content

Commit

Permalink
[fix] Java's default session timeout in 24h
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jul 1, 2022
1 parent f957572 commit 0b799fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/jruby/ext/openssl/SSLSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 0b799fd

Please sign in to comment.