diff options
author | daurnimator <quae@daurnimator.com> | 2016-12-08 02:53:25 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2016-12-08 02:53:25 +1100 |
commit | 33ac392bf9b18789382af635c97d58742ab0bce3 (patch) | |
tree | 5b17d811d0fb0c0e985ada01cdea4b85cad8e160 | |
parent | 73a56ebd71ab15006f699e3719e049161091253b (diff) | |
download | luaossl-33ac392bf9b18789382af635c97d58742ab0bce3.tar.gz luaossl-33ac392bf9b18789382af635c97d58742ab0bce3.tar.bz2 luaossl-33ac392bf9b18789382af635c97d58742ab0bce3.zip |
In ssl_setHostName allow clearing hostname by passing nil
-rw-r--r-- | src/openssl.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { | |||
7720 | 7720 | ||
7721 | static int ssl_setHostName(lua_State *L) { | 7721 | static int ssl_setHostName(lua_State *L) { |
7722 | SSL *ssl = checksimple(L, 1, SSL_CLASS); | 7722 | SSL *ssl = checksimple(L, 1, SSL_CLASS); |
7723 | const char *host = luaL_checkstring(L, 2); | 7723 | const char *host = luaL_optstring(L, 2, NULL); |
7724 | 7724 | ||
7725 | if (!SSL_set_tlsext_host_name(ssl, host)) | 7725 | if (!SSL_set_tlsext_host_name(ssl, host)) |
7726 | return auxL_error(L, auxL_EOPENSSL, "ssl:setHostName"); | 7726 | return auxL_error(L, auxL_EOPENSSL, "ssl:setHostName"); |