From 33ac392bf9b18789382af635c97d58742ab0bce3 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 8 Dec 2016 02:53:25 +1100 Subject: In ssl_setHostName allow clearing hostname by passing nil --- src/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openssl.c b/src/openssl.c index 78ab3a0..39612e0 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -7720,7 +7720,7 @@ static int ssl_getHostName(lua_State *L) { static int ssl_setHostName(lua_State *L) { SSL *ssl = checksimple(L, 1, SSL_CLASS); - const char *host = luaL_checkstring(L, 2); + const char *host = luaL_optstring(L, 2, NULL); if (!SSL_set_tlsext_host_name(ssl, host)) return auxL_error(L, auxL_EOPENSSL, "ssl:setHostName"); -- cgit v1.2.3-55-g6feb