Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

2way-ssl and server hostname #499

Open
kelvinkwong opened this issue Jan 31, 2019 · 4 comments
Open

2way-ssl and server hostname #499

kelvinkwong opened this issue Jan 31, 2019 · 4 comments

Comments

@kelvinkwong
Copy link

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:

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)

@kelvinkwong
Copy link
Author

wrt to Branch == develop

@Neustradamus
Copy link

@kelvinkwong: Better to create a PR no?

@kelvinkwong
Copy link
Author

@Neustradamus whats a PR? Sorry new to terms

@Neustradamus
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants