ssl request support sni(Server Name Indication) (#1460)

* ssl support sni(Server Name Indication)

* ssl support sni(Server Name Indication)
This commit is contained in:
colin
2021-08-23 16:54:01 +08:00
committed by GitHub
parent fdc4b35281
commit 6ee8d23ac4
4 changed files with 29 additions and 17 deletions

View File

@@ -358,6 +358,10 @@ lnew_tls(lua_State* L) {
if(strcmp(method, "client") == 0) {
_init_client_context(L, tls_p, ctx_p);
if (!lua_isnoneornil(L, 3)) {
const char* hostname = luaL_checkstring(L, 3);
SSL_set_tlsext_host_name(tls_p->ssl, hostname);
}
}else if(strcmp(method, "server") == 0) {
_init_server_context(L, tls_p, ctx_p);
} else {