Comparison

net/server_select.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 9851:75d2874502c3
child 9916:72501e3c1427
comparison
equal deleted inserted replaced
9852:6ea3cafb6ac3 9853:9aea8dbb105d
635 end 635 end
636 636
637 if socket.sni then 637 if socket.sni then
638 if self.servername then 638 if self.servername then
639 socket:sni(self.servername); 639 socket:sni(self.servername);
640 elseif self.server() and self.server().hosts then 640 elseif self._server and type(self._server.hosts) == "table" and next(self._server.hosts) ~= nil then
641 socket:sni(self.server().hosts, true); 641 socket:sni(self.server().hosts, true);
642 end 642 end
643 end 643 end
644 644
645 socket:settimeout( 0 ) 645 socket:settimeout( 0 )