aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-11 13:00:51 +0100
committerKim Alvefur <zash@zash.se>2019-03-11 13:00:51 +0100
commit5d2608e150b7a739c0b1658fd2e9031af9ad2991 (patch)
treedd2e536584dca2521bced9dcca3634edb996862d /net/server_epoll.lua
parent9f65ce71893ef10485442ee209472a38865da081 (diff)
downloadprosody-5d2608e150b7a739c0b1658fd2e9031af9ad2991.tar.gz
prosody-5d2608e150b7a739c0b1658fd2e9031af9ad2991.zip
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.
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 3c8b2613..4bdc2e21 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -512,7 +512,7 @@ function interface:tlshandskake()
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