Software /
code /
prosody
Comparison
net/server_event.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 | 9850:9a905888b96c |
child | 9897:a471d4cfec5e |
comparison
equal
deleted
inserted
replaced
9852:6ea3cafb6ac3 | 9853:9aea8dbb105d |
---|---|
166 end | 166 end |
167 | 167 |
168 if self.conn.sni then | 168 if self.conn.sni then |
169 if self.servername then | 169 if self.servername then |
170 self.conn:sni(self.servername); | 170 self.conn:sni(self.servername); |
171 elseif self._server and self._server.hosts then | 171 elseif self._server and type(self._server.hosts) == "table" and next(self._server.hosts) ~= nil then |
172 self.conn:sni(self._server.hosts, true); | 172 self.conn:sni(self._server.hosts, true); |
173 end | 173 end |
174 end | 174 end |
175 | 175 |
176 self.conn:settimeout( 0 ) -- set non blocking | 176 self.conn:settimeout( 0 ) -- set non blocking |