Diff

net/server_event.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 9850:9a905888b96c
child 9897:a471d4cfec5e
line wrap: on
line diff
--- a/net/server_event.lua	Sun Mar 10 19:58:28 2019 +0100
+++ b/net/server_event.lua	Mon Mar 11 13:00:51 2019 +0100
@@ -168,7 +168,7 @@
 	if self.conn.sni then
 		if self.servername then
 			self.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
 			self.conn:sni(self._server.hosts, true);
 		end
 	end