diff --git a/src/node_crypto.cc b/src/node_crypto.cc index cf43cc6504..bf95d79701 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -993,7 +993,10 @@ Handle Connection::New(const Arguments& args) { } -void Connection::SSLInfoCallback(const SSL *ssl, int where, int ret) { +void Connection::SSLInfoCallback(const SSL *ssl_, int where, int ret) { + // Be compatible with older versions of OpenSSL. SSL_get_app_data() wants + // a non-const SSL* in OpenSSL <= 0.9.7e. + SSL* ssl = const_cast(ssl_); if (where & SSL_CB_HANDSHAKE_START) { HandleScope scope; Connection* c = static_cast(SSL_get_app_data(ssl));