diff options
author | Kim Alvefur <zash@zash.se> | 2019-03-10 19:35:34 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-03-10 19:35:34 +0100 |
commit | ac2aeb46621d033813e7ca0730302dfff2a6d4a6 (patch) | |
tree | a784b9aaf374f54320da402928756ec5be3c143f /net/server_epoll.lua | |
parent | 7f1a7179dde0dc2569c4100b307a55c6c2a71fd2 (diff) | |
download | prosody-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.lua | 8 |
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); |