Diff

net/server_epoll.lua @ 9853:9aea8dbb105d

net.server: Only add alternate SNI contexts if at least one is provided Fixes use of <starttls/> when a client sends SNI, which would send no certificate otherwise.
author Kim Alvefur <zash@zash.se>
date Mon, 11 Mar 2019 13:00:51 +0100
parent 9847:adc0672b700e
child 9855:6c2370f17027
line wrap: on
line diff
--- a/net/server_epoll.lua	Sun Mar 10 19:58:28 2019 +0100
+++ b/net/server_epoll.lua	Mon Mar 11 13:00:51 2019 +0100
@@ -512,7 +512,7 @@
 		if conn.sni then
 			if self.servername then
 				conn:sni(self.servername);
-			elseif self._server and self._server.hosts then
+			elseif self._server and type(self._server.hosts) == "table" and next(self._server.hosts) ~= nil then
 				conn:sni(self._server.hosts, true);
 			end
 		end