Software /
code /
prosody
Diff
net/server_select.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 | 9851:75d2874502c3 |
child | 9916:72501e3c1427 |
line wrap: on
line diff
--- a/net/server_select.lua Sun Mar 10 19:58:28 2019 +0100 +++ b/net/server_select.lua Mon Mar 11 13:00:51 2019 +0100 @@ -637,7 +637,7 @@ if socket.sni then if self.servername then socket: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 socket:sni(self.server().hosts, true); end end