mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
https set extension:server_name (#1960)
Co-authored-by: root <root@DESKTOP-5DF4NN3.localdomain>
This commit is contained in:
@@ -267,6 +267,15 @@ _ltls_context_write(lua_State* L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_lset_ext_host_name(lua_State* L) {
|
||||
struct tls_context* tls_p = _check_context(L, 1);
|
||||
size_t slen = 0;
|
||||
char* host = (char*)lua_tolstring(L, 2, &slen);
|
||||
int ret = SSL_set_tlsext_host_name(tls_p->ssl, host);
|
||||
lua_pushinteger(L, ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_lctx_gc(lua_State* L) {
|
||||
@@ -378,6 +387,7 @@ lnew_tls(lua_State* L) {
|
||||
{"handshake", _ltls_context_handshake},
|
||||
{"read", _ltls_context_read},
|
||||
{"write", _ltls_context_write},
|
||||
{"set_ext_host_name", _lset_ext_host_name},
|
||||
{NULL, NULL},
|
||||
};
|
||||
luaL_newlib(L, l);
|
||||
|
||||
Reference in New Issue
Block a user