Client Certificate is not configured in XMLStream._create_secure_socket() for Python > 3.4
Please change line 473:
ctx.load_verify_locations(cafile=self.ca_certs)
to:
if self.ca_certs:
ctx.load_verify_locations(cafile=self.ca_certs)
if self.certfile and self.keyfile:
ctx.load_cert_chain(self.certfile, self.keyfile)
So it checks the certificates are not None, before committing it in connection.
Server Hostname
Also, Server hostname is required on my instance in XMLStream._create_secure_socket(). Not sure if everybody needs it. On line 523:
return ctx.wrap_socket(self.socket, do_handshake_on_connect=False)
To:
return ctx.wrap_socket(self.socket, do_handshake_on_connect=False, server_hostname=self._expected_server_name)
Client Certificate
Client Certificate is not configured in XMLStream._create_secure_socket() for Python > 3.4
Please change line 473:
ctx.load_verify_locations(cafile=self.ca_certs)
to:So it checks the certificates are not None, before committing it in connection.
Server Hostname
Also, Server hostname is required on my instance in XMLStream._create_secure_socket(). Not sure if everybody needs it. On line 523:
return ctx.wrap_socket(self.socket, do_handshake_on_connect=False)
To:return ctx.wrap_socket(self.socket, do_handshake_on_connect=False, server_hostname=self._expected_server_name)