Skip to content

Commit aefb6c3

Browse files
committed
Always return a Fixnum here. openssl defaults to 300.
1 parent 68bc5cb commit aefb6c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ public IRubyObject set_time(final ThreadContext context, IRubyObject time) {
134134
@JRubyMethod(name = "timeout")
135135
public IRubyObject timeout(final ThreadContext context) {
136136
final SSLSessionContext sessionContext = sslSession().getSessionContext();
137-
if ( sessionContext == null ) return context.nil;
137+
// default in OpenSSL is 300
138+
if ( sessionContext == null ) return context.runtime.newFixnum(300);
138139
return context.runtime.newFixnum(sessionContext.getSessionTimeout());
139140
}
140141

0 commit comments

Comments
 (0)