Skip to content

Commit

Permalink
[refactor] a note on renegotiation_callback being incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jul 3, 2022
1 parent e1242f5 commit b21f73f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/java/org/jruby/ext/openssl/SSLSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -663,17 +663,14 @@ private void finishInitialHandshake() {
session.putValue(SESSION_SOCKET_ID, getObjectId());
}
}


// NOTE: gets called on negotiation connect/accept - not really on RE-negotiation as intended?!
private void callRenegotiationCallback(final ThreadContext context) throws RaiseException {
IRubyObject renegotiationCallback = sslContext.getInstanceVariable("@renegotiation_cb");
if(renegotiationCallback == null || renegotiationCallback.isNil()) {
return;
}
else {
// the return of the Proc is not important
// Can throw ruby exception to "disallow" renegotiations
renegotiationCallback.callMethod(context, "call", this);
}
if (renegotiationCallback == null || renegotiationCallback.isNil()) return;
// the return of the Proc is not important
// Can throw ruby exception to "disallow" re-negotiations
renegotiationCallback.callMethod(context, "call", this);
}

public int write(ByteBuffer src, boolean blocking) throws SSLException, IOException {
Expand Down

0 comments on commit b21f73f

Please sign in to comment.