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

Set ssl.OP_LEGACY_SERVER_CONNECT in order to be able to connect to unsafe SSL servers that OpenSSL 3.0.0 prohibits by default now. #362

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ class cipherAdapter(HTTPAdapter):
A HTTPAdapter that re-enables poor ciphers required by Hyundai.
"""

def init_poolmanager(self, *args, **kwargs):
def _setup_ssl_context(self):
context = create_urllib3_context(ciphers=CIPHERS)
kwargs["ssl_context"] = context
context.options |= 0x4

return context

def init_poolmanager(self, *args, **kwargs):
kwargs["ssl_context"] = self._setup_ssl_context()

return super().init_poolmanager(*args, **kwargs)

def proxy_manager_for(self, *args, **kwargs):
context = create_urllib3_context(ciphers=CIPHERS)
kwargs["ssl_context"] = context
kwargs["ssl_context"] = self._setup_ssl_context()

return super().proxy_manager_for(*args, **kwargs)


Expand Down