Skip to content

Commit f957572

Browse files
committed
[fix] handle ArgumentError on SSLSession#timeout=
1 parent 75a66e1 commit f957572

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ public IRubyObject set_timeout(final ThreadContext context, IRubyObject timeout)
154154
warn(context, "WARNING: can not set OpenSSL::SSL::Session#timeout=("+ timeout +") no session context");
155155
return context.nil;
156156
}
157-
sessionContext.setSessionTimeout(RubyNumeric.fix2int(timeout)); // in seconds as well
157+
try {
158+
sessionContext.setSessionTimeout(RubyNumeric.fix2int(timeout)); // in seconds as well
159+
} catch (IllegalArgumentException e) {
160+
throw context.runtime.newArgumentError(e.getMessage());
161+
}
158162
return timeout;
159163
}
160164

0 commit comments

Comments
 (0)