Skip to content

Commit 8dd8033

Browse files
shigekiBethGriggs
authored andcommitted
tls: workaround handshakedone in renegotiation
`SSL_CB_HANDSHAKE_START` and `SSL_CB_HANDSHAKE_DONE` are called sending HelloRequest in OpenSSL-1.1.1. We need to check whether this is in a renegotiation state or not. Backport-PR-URL: #26270 PR-URL: #25381 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
1 parent 56441a0 commit 8dd8033

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tls_wrap.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
221221
}
222222
}
223223

224-
if (where & SSL_CB_HANDSHAKE_DONE) {
224+
// SSL_CB_HANDSHAKE_START and SSL_CB_HANDSHAKE_DONE are called
225+
// sending HelloRequest in OpenSSL-1.1.1.
226+
// We need to check whether this is in a renegotiation state or not.
227+
if (where & SSL_CB_HANDSHAKE_DONE && !SSL_renegotiate_pending(ssl)) {
225228
c->established_ = true;
226229
Local<Value> callback = object->Get(env->onhandshakedone_string());
227230
if (callback->IsFunction()) {

0 commit comments

Comments
 (0)