| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b5d16cd commit 62e2e59
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,7 +223,7 @@ int SelectALPNCallback( | |||
| 223 | 223 | const unsigned char* in, | |
| 224 | 224 | unsigned int inlen, | |
| 225 | 225 | void* arg) { | |
| 226 | - TLSWrap* w = static_cast<TLSWrap*>(arg); | ||
| 226 | + TLSWrap* w = static_cast<TLSWrap*>(SSL_get_app_data(s)); | ||
| 227 | 227 | if (w->alpn_callback_enabled_) { | |
| 228 | 228 | Environment* env = w->env(); | |
| 229 | 229 | HandleScope handle_scope(env->isolate()); | |
@@ -1293,7 +1293,8 @@ void TLSWrap::EnableALPNCb(const FunctionCallbackInfo<Value>& args) { | |||
| 1293 | 1293 | wrap->alpn_callback_enabled_ = true; | |
| 1294 | 1294 | ||
| 1295 | 1295 | SSL* ssl = wrap->ssl_.get(); | |
| 1296 | - SSL_CTX_set_alpn_select_cb(SSL_get_SSL_CTX(ssl), SelectALPNCallback, wrap); | ||
| 1296 | + SSL_CTX* ssl_ctx = SSL_get_SSL_CTX(ssl); | ||
| 1297 | + SSL_CTX_set_alpn_select_cb(ssl_ctx, SelectALPNCallback, nullptr); | ||
| 1297 | 1298 | } | |
| 1298 | 1299 | ||
| 1299 | 1300 | void TLSWrap::GetServername(const FunctionCallbackInfo<Value>& args) { | |
@@ -1589,7 +1590,8 @@ void TLSWrap::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) { | |||
| 1589 | 1590 | } else { | |
| 1590 | 1591 | w->alpn_protos_ = std::vector<unsigned char>( | |
| 1591 | 1592 | protos.data(), protos.data() + protos.length()); | |
| 1592 | - SSL_CTX_set_alpn_select_cb(SSL_get_SSL_CTX(ssl), SelectALPNCallback, w); | ||
| 1593 | + SSL_CTX* ssl_ctx = SSL_get_SSL_CTX(ssl); | ||
| 1594 | + SSL_CTX_set_alpn_select_cb(ssl_ctx, SelectALPNCallback, nullptr); | ||
| 1593 | 1595 | } | |
| 1594 | 1596 | } | |
| 1595 | 1597 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments