diff --git a/tlslite/tlsconnection.py b/tlslite/tlsconnection.py index 3bd7daf4e..75bd35fd8 100644 --- a/tlslite/tlsconnection.py +++ b/tlslite/tlsconnection.py @@ -2013,8 +2013,12 @@ def _handshakeServerAsyncHelper(self, verifierDB, self._handshakeStart(client=False) + if not settings: + settings = HandshakeSettings() + settings = settings.validate() + if (not verifierDB) and (not cert_chain) and not anon and \ - not settings.pskConfigs: + not settings.pskConfigs and not settings.virtual_hosts: raise ValueError("Caller passed no authentication credentials") if cert_chain and not privateKey: raise ValueError("Caller passed a cert_chain but no privateKey") @@ -2034,9 +2038,6 @@ def _handshakeServerAsyncHelper(self, verifierDB, if alpn is not None and not alpn: raise ValueError("Empty list of ALPN protocols") - if not settings: - settings = HandshakeSettings() - settings = settings.validate() self.sock.padding_cb = settings.padding_cb # OK Start exchanging messages