Skip to content

Commit

Permalink
check for credentials in virtual hosts too
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Oct 25, 2019
1 parent 3beff18 commit 2ccf74b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 2ccf74b

Please sign in to comment.