From ea44d3031d101b42b427e2b33355e27ec616e731 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Mar 2012 15:52:12 +0100 Subject: [PATCH] crypto: fix compile-time error with openssl <= 0.9.7e --- src/node_crypto.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index cf43cc650..bf95d7970 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));