aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index a9440258..ad888ef4 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -463,7 +463,11 @@ function interface:tlshandskake()
self._tls = true;
log("debug", "Start TLS on %s now", self);
self:del();
- local conn, err = luasec.wrap(self.conn, self.tls_ctx);
+ local ok, conn, err = pcall(luasec.wrap, self.conn, self.tls_ctx);
+ if not ok then
+ log("error", "Failed to initialize TLS: %s", conn);
+ conn, err = ok, conn;
+ end
if not conn then
self:on("disconnect", err);
self:destroy();