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

2way-ssl and server hostname #499

@kelvinkwong

Description

@kelvinkwong

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions