Skip to content

Commit cccc33b

Browse files
committed
src: const_cast is necessary for 1.1.1, not 0.9.7
The const_cast used to be necessary for SSL_get_app_data() in OpenSSL 0.9.7, but node doesn't compile against OpenSSL versions that old. However, now it's needed for the recently introduced SSL_renegotiate_pending(), which is not const-correct as of 1.1.1a. PR-URL: #25861 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 80f92cf commit cccc33b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tls_wrap.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,9 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
210210
if (!(where & (SSL_CB_HANDSHAKE_START | SSL_CB_HANDSHAKE_DONE)))
211211
return;
212212

213-
// Be compatible with older versions of OpenSSL. SSL_get_app_data() wants
214-
// a non-const SSL* in OpenSSL <= 0.9.7e.
213+
// SSL_renegotiate_pending() should take `const SSL*`, but it does not.
215214
SSL* ssl = const_cast<SSL*>(ssl_);
216-
TLSWrap* c = static_cast<TLSWrap*>(SSL_get_app_data(ssl));
215+
TLSWrap* c = static_cast<TLSWrap*>(SSL_get_app_data(ssl_));
217216
Environment* env = c->env();
218217
HandleScope handle_scope(env->isolate());
219218
Context::Scope context_scope(env->context());

0 commit comments

Comments
 (0)