Skip to content

Commit b612897

Browse files
committed
[refactor] freeze SSLContext when everything okay
1 parent 55380ec commit b612897

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,6 @@ public IRubyObject setup(final ThreadContext context) {
339339

340340
if ( isFrozen() ) return runtime.getNil();
341341

342-
synchronized(this) {
343-
if ( isFrozen() ) return runtime.getNil();
344-
this.freeze(context);
345-
}
346-
347342
final X509Store certStore = getCertStore();
348343

349344
// TODO: handle tmp_dh_callback :
@@ -513,6 +508,8 @@ public IRubyObject setup(final ThreadContext context) {
513508
throw newSSLError(runtime, e);
514509
}
515510

511+
this.freeze(context);
512+
516513
return runtime.getTrue();
517514
}
518515

0 commit comments

Comments
 (0)