Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROTON-1355: Set ssl.peer_hostname to virtual_host if specified #90

Closed
wants to merge 1 commit into from

Conversation

lulf
Copy link

@lulf lulf commented Nov 18, 2016

No description provided.

@@ -565,7 +565,7 @@ def _connect(self, connection, reactor):
if not self.ssl_domain:
raise SSLUnavailable("amqps: SSL libraries not found")
self.ssl = SSL(transport, self.ssl_domain)
self.ssl.peer_hostname = url.host
self.ssl.peer_hostname = self.virtual_host if self.virtual_host != None else url.host
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that None has truthiness of false so this can be written more simply as:
... = self.virtual_host if self.virtual_host else url.host

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I chose to write it this way to be consistent with the rest of the code which seems to explicitly check for None.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually you can write it even more clearly ...
... = self.virtual_host or url.host

@asfgit asfgit closed this in e99d074 Dec 8, 2016
@lulf lulf deleted the PROTON-1355 branch December 8, 2016 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants