Skip to content

Commit

Permalink
[refactor] freeze SSLContext when everything okay
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed May 22, 2024
1 parent 1924cd1 commit 3540c75
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/org/jruby/ext/openssl/SSLContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down Expand Up @@ -513,6 +508,8 @@ public IRubyObject setup(final ThreadContext context) {
throw newSSLError(runtime, e);
}

this.freeze(context);

return runtime.getTrue();
}

Expand Down

0 comments on commit 3540c75

Please sign in to comment.