From 764055ea7bf5c42f943f33be8eb4ffac8e4d0f7f Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 7 Apr 2022 13:24:11 -0500 Subject: [PATCH] Add additional attr callbacks for session_cb These are called by at least the default net-http gem, so we need these methods to be present. I am not sure how much functionality they need to have; in CRuby, they are just bound as attr readers/ writers. See #249 and jruby/jruby#7088 --- src/main/java/org/jruby/ext/openssl/SSLContext.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/jruby/ext/openssl/SSLContext.java b/src/main/java/org/jruby/ext/openssl/SSLContext.java index fe24f51e..34364a6f 100644 --- a/src/main/java/org/jruby/ext/openssl/SSLContext.java +++ b/src/main/java/org/jruby/ext/openssl/SSLContext.java @@ -249,6 +249,10 @@ public static void createSSLContext(final Ruby runtime, final RubyModule SSL) { SSLContext.addReadWriteAttribute(context, "alpn_protocols"); SSLContext.addReadWriteAttribute(context, "alpn_select_cb"); + SSLContext.addReadWriteAttribute(context, "session_get_cb"); + SSLContext.addReadWriteAttribute(context, "session_new_cb"); + SSLContext.addReadWriteAttribute(context, "session_remove_cb"); + SSLContext.defineAlias("ssl_timeout", "timeout"); SSLContext.defineAlias("ssl_timeout=", "timeout=");