Software /
code /
prosody
Comparison
net/server_epoll.lua @ 9853:9aea8dbb105d
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 11 Mar 2019 13:00:51 +0100 |
parent | 9847:adc0672b700e |
child | 9855:6c2370f17027 |
comparison
equal
deleted
inserted
replaced
9852:6ea3cafb6ac3 | 9853:9aea8dbb105d |
---|---|
510 conn:settimeout(0); | 510 conn:settimeout(0); |
511 self.conn = conn; | 511 self.conn = conn; |
512 if conn.sni then | 512 if conn.sni then |
513 if self.servername then | 513 if self.servername then |
514 conn:sni(self.servername); | 514 conn:sni(self.servername); |
515 elseif self._server and self._server.hosts then | 515 elseif self._server and type(self._server.hosts) == "table" and next(self._server.hosts) ~= nil then |
516 conn:sni(self._server.hosts, true); | 516 conn:sni(self._server.hosts, true); |
517 end | 517 end |
518 end | 518 end |
519 self:on("starttls"); | 519 self:on("starttls"); |
520 self.ondrain = nil; | 520 self.ondrain = nil; |