From 3540c75189f375430a69b8a396b6fef908e53d0d Mon Sep 17 00:00:00 2001 From: kares Date: Wed, 22 May 2024 19:18:37 +0200 Subject: [PATCH] [refactor] freeze SSLContext when everything okay --- src/main/java/org/jruby/ext/openssl/SSLContext.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jruby/ext/openssl/SSLContext.java b/src/main/java/org/jruby/ext/openssl/SSLContext.java index 76380b5d..ddaa4711 100644 --- a/src/main/java/org/jruby/ext/openssl/SSLContext.java +++ b/src/main/java/org/jruby/ext/openssl/SSLContext.java @@ -339,11 +339,6 @@ public IRubyObject setup(final ThreadContext context) { if ( isFrozen() ) return runtime.getNil(); - synchronized(this) { - if ( isFrozen() ) return runtime.getNil(); - this.freeze(context); - } - final X509Store certStore = getCertStore(); // TODO: handle tmp_dh_callback : @@ -513,6 +508,8 @@ public IRubyObject setup(final ThreadContext context) { throw newSSLError(runtime, e); } + this.freeze(context); + return runtime.getTrue(); }