Fix: Refactor SSL socket wrapping in ValidatedHTTPSConnection#70
Open
ethanke wants to merge 1 commit intoaszlig:masterfrom
Open
Fix: Refactor SSL socket wrapping in ValidatedHTTPSConnection#70ethanke wants to merge 1 commit intoaszlig:masterfrom
ethanke wants to merge 1 commit intoaszlig:masterfrom
Conversation
Updated the SSL socket wrapping mechanism to use ssl.create_default_context() for improved security and maintainability. The previous method of wrapping the socket has been replaced with a context that loads verification locations if a CA file is provided.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File c:\Users\Ethan\Hobby\Rustle.venv\Lib\site-packages\hetzner\robot.py:391, in ServerManager.iter(self)
390 def iter(self):
--> 391 return iter([Server(self.conn, s) for s in self.conn.get('/server')])
File c:\Users\Ethan\Hobby\Rustle.venv\Lib\site-packages\hetzner\robot.py:368, in RobotConnection.get(self, path)
367 def get(self, path):
--> 368 return self.request('GET', path)
File c:\Users\Ethan\Hobby\Rustle.venv\Lib\site-packages\hetzner\robot.py:329, in RobotConnection.request(self, method, path, data, allow_empty)
325 headers['Content-Type'] = 'application/x-www-form-urlencoded'
327 self.logger.debug("Sending %s request to Robot at %s with data %r.",
328 method, path, data)
--> 329 response = self._request(method, path, data, headers)
330 raw_data = response.read().decode('utf-8')
331 if len(raw_data) == 0 and not allow_empty:
File c:\Users\Ethan\Hobby\Rustle.venv\Lib\site-packages\hetzner\robot.py:301, in RobotConnection._request(self, method, path, data, headers, retry)
300 def _request(self, method, path, data, headers, retry=1):
...
68 ca_certs=cafile)
69 if bundle is None:
70 ca_certs.close()
AttributeError: module 'ssl' has no attribute 'wrap_socket'
Updated the SSL socket wrapping mechanism to use ssl.create_default_context() for improved security and maintainability. The previous method of wrapping the socket has been replaced with a context that loads verification locations if a CA file is provided.