crypto: unbreak build with no-NPN shared openssl
authorBen Noordhuis <info@bnoordhuis.nl>
Fri, 8 Nov 2013 16:47:39 +0000 (17:47 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 8 Nov 2013 16:50:01 +0000 (17:50 +0100)
Unbreak the build when linking against a shared version of OpenSSL that
doesn't support NPN (Next Protocol Negotiation.)

Fixes the following build error:

  ../src/node_crypto.cc:140: error: no member function
  'AdvertiseNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'
  ../src/node_crypto.cc:147: error: no member function
  'SelectNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'

src/node_crypto.cc

index 857d586..3bc5505 100644 (file)
@@ -117,6 +117,8 @@ template int SSLWrap<TLSCallbacks>::NewSessionCallback(SSL* s,
 template void SSLWrap<TLSCallbacks>::OnClientHello(
     void* arg,
     const ClientHelloParser::ClientHello& hello);
+
+#ifdef OPENSSL_NPN_NEGOTIATED
 template int SSLWrap<TLSCallbacks>::AdvertiseNextProtoCallback(
     SSL* s,
     const unsigned char** data,
@@ -129,6 +131,7 @@ template int SSLWrap<TLSCallbacks>::SelectNextProtoCallback(
     const unsigned char* in,
     unsigned int inlen,
     void* arg);
+#endif
 
 
 static void crypto_threadid_cb(CRYPTO_THREADID* tid) {