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

Close socket on tls n response #486

Closed

Conversation

DMickens
Copy link
Contributor

@DMickens DMickens commented Feb 2, 2023

Small change to make sure the socket is closed when SSL negotiation winds up restricting the opening of an SSL Socket.

@@ -541,6 +541,7 @@ def enable_ssl(self, raw_socket, ssl_options):
else:
err_msg = "SSL requested but not supported by server"
self._logger.error(err_msg)
self.close_socket()
Copy link
Member

Choose a reason for hiding this comment

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

This close_socket() function only works when the connection is established, enabling TLS is just before that step. So this line actually doesn't take effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay. I originally had raw_socket.close() before seeing the close_socket function, but that makes sense. I'll close this PR

@DMickens DMickens closed this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants