Update the Lua state reference on the selected SSL context after SNI

Thanks Kim Alvefur
This commit is contained in:
Bruno Silvestre 2021-08-02 16:13:12 -03:00
parent eedebb2477
commit 8cba350f37

View File

@ -747,6 +747,8 @@ static int sni_cb(SSL *ssl, int *ad, void *arg)
lua_pop(L, 4);
/* Found, use this context */
if (newctx) {
p_context pctx = (p_context)SSL_CTX_get_app_data(newctx);
pctx->L = L;
SSL_set_SSL_CTX(ssl, newctx);
return SSL_TLSEXT_ERR_OK;
}