From b612897f6b1dae08d0f0bd0233988b0e091c857b 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(); }