aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
commita1ef28548caaf3dc474b4c638aee917e2ca1563d (patch)
treea784b9aaf374f54320da402928756ec5be3c143f /net
parent99e25a9093b7a1cc66b7784e3b805b60f092f9da (diff)
downloadprosody-a1ef28548caaf3dc474b4c638aee917e2ca1563d.tar.gz
prosody-a1ef28548caaf3dc474b4c638aee917e2ca1563d.zip
net.server_epoll: Add support for SNI (#409)
Diffstat (limited to 'net')
-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);