Skip to content

Commit

Permalink
Update SSL context to enable ssl.OP_LEGACY_SERVER_CONNECT, which isn'…
Browse files Browse the repository at this point in the history
…t in Python yet, but in OpenSSL its value is 0x4 in the bitfield. (#362)
  • Loading branch information
borski authored Jul 19, 2023
1 parent 5cca136 commit bc93e02
Showing 1 changed file with 10 additions and 4 deletions.
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

0 comments on commit bc93e02

Please sign in to comment.