@@ -104,7 +104,7 @@ X509_STORE* root_cert_store;
104
104
template class SSLWrap <TLSWrap>;
105
105
template void SSLWrap<TLSWrap>::AddMethods(Environment* env,
106
106
Handle <FunctionTemplate> t);
107
- template void SSLWrap<TLSWrap>::InitNPN(TLSWrap* w, SecureContext* sc);
107
+ template void SSLWrap<TLSWrap>::InitNPN(SecureContext* sc);
108
108
template SSL_SESSION* SSLWrap<TLSWrap>::GetSessionCallback(
109
109
SSL* s,
110
110
unsigned char * key,
@@ -1012,7 +1012,7 @@ void SSLWrap<Base>::AddMethods(Environment* env, Handle<FunctionTemplate> t) {
1012
1012
1013
1013
1014
1014
template <class Base >
1015
- void SSLWrap<Base>::InitNPN(Base* w, SecureContext* sc) {
1015
+ void SSLWrap<Base>::InitNPN(SecureContext* sc) {
1016
1016
#ifdef OPENSSL_NPN_NEGOTIATED
1017
1017
// Server should advertise NPN protocols
1018
1018
SSL_CTX_set_next_protos_advertised_cb (sc->ctx_ ,
@@ -1028,8 +1028,6 @@ void SSLWrap<Base>::InitNPN(Base* w, SecureContext* sc) {
1028
1028
SSL_CTX_set_tlsext_status_cb (sc->ctx_ , TLSExtStatusCallback);
1029
1029
SSL_CTX_set_tlsext_status_arg (sc->ctx_ , nullptr );
1030
1030
#endif // NODE__HAVE_TLSEXT_STATUS_CB
1031
-
1032
- SSL_set_cert_cb (w->ssl_ , SSLWrap<Base>::SSLCertCallback, w);
1033
1031
}
1034
1032
1035
1033
@@ -2257,7 +2255,7 @@ int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) {
2257
2255
if (secure_context_constructor_template->HasInstance (ret)) {
2258
2256
conn->sni_context_ .Reset (env->isolate (), ret);
2259
2257
SecureContext* sc = Unwrap<SecureContext>(ret.As <Object>());
2260
- InitNPN (conn, sc);
2258
+ InitNPN (sc);
2261
2259
SSL_set_SSL_CTX (s, sc->ctx_ );
2262
2260
} else {
2263
2261
return SSL_TLSEXT_ERR_NOACK;
@@ -2292,7 +2290,9 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
2292
2290
if (is_server)
2293
2291
SSL_set_info_callback (conn->ssl_ , SSLInfoCallback);
2294
2292
2295
- InitNPN (conn, sc);
2293
+ InitNPN (sc);
2294
+
2295
+ SSL_set_cert_cb (conn->ssl_ , SSLWrap<Connection>::SSLCertCallback, conn);
2296
2296
2297
2297
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
2298
2298
if (is_server) {
0 commit comments