diff --git a/kuksa-client/kuksa_client/cli_backend/ws.py b/kuksa-client/kuksa_client/cli_backend/ws.py index effd204..5938bf4 100644 --- a/kuksa-client/kuksa_client/cli_backend/ws.py +++ b/kuksa-client/kuksa_client/cli_backend/ws.py @@ -297,8 +297,13 @@ async def connect(self, _=None): subprotocols = ["VISSv2"] if not self.insecure: context = ssl.create_default_context() - context.load_cert_chain( - certfile=self.certificate, keyfile=self.keyfile) + if self.certificate is not None and \ + self.keyfile is not None: + logger.debug("Credentials used for mutual authentication; " + "Client certificate file = %s, Client key file = %s", + self.certificate, self.keyfile) + context.load_cert_chain( + certfile=self.certificate, keyfile=self.keyfile) context.load_verify_locations(cafile=self.cacertificate) # We want host name to match # For example certificates we use subjectAltName to make it match for Server, localahost and 127.0.0.1