aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-10 19:35:34 +0100
committerKim Alvefur <zash@zash.se>2019-03-10 19:35:34 +0100
commitac2aeb46621d033813e7ca0730302dfff2a6d4a6 (patch)
treea784b9aaf374f54320da402928756ec5be3c143f /net/server_epoll.lua
parent7f1a7179dde0dc2569c4100b307a55c6c2a71fd2 (diff)
downloadprosody-ac2aeb46621d033813e7ca0730302dfff2a6d4a6.tar.gz
prosody-ac2aeb46621d033813e7ca0730302dfff2a6d4a6.zip
net.server_epoll: Add support for SNI (#409)
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 5609f058..3c8b2613 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -509,6 +509,13 @@ function interface:tlshandskake()
end
conn:settimeout(0);
self.conn = conn;
+ if conn.sni then
+ if self.servername then
+ conn:sni(self.servername);
+ elseif self._server and self._server.hosts then
+ conn:sni(self._server.hosts, true);
+ end
+ end
self:on("starttls");
self.ondrain = nil;
self.onwritable = interface.tlshandskake;
@@ -649,6 +656,7 @@ local function listen(addr, port, listeners, config)
onreadable = interface.onacceptable;
tls_ctx = config and config.tls_ctx;
tls_direct = config and config.tls_direct;
+ hosts = config and config.sni_hosts;
sockname = addr;
sockport = port;
}, interface_mt);