Skip to content

Commit

Permalink
Prevent unnecessary load_default_certs call
Browse files Browse the repository at this point in the history
  • Loading branch information
ms264556 committed Aug 14, 2024
1 parent ae81c76 commit e08db3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aioruckus/ajaxsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ def api(self) -> "RuckusAjaxApi":
@classmethod
def async_create(cls, host: str, username: str, password: str) -> "AjaxSession":
"""Create a default ClientSession & use this to create an AjaxSession instance"""
# create SSLContext which ignores certificate errors
ssl_context = ssl.create_default_context()
ssl_context.set_ciphers("DEFAULT")
# create SSLContext which ignores certificate errors and allows old ciphers
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
ssl_context.set_ciphers("DEFAULT")
# create ClientSession using our SSLContext, allowing cookies on IP address URLs,
# with a short keepalive for compatibility with old Unleashed versions
websession = aiohttp.ClientSession(
Expand Down

0 comments on commit e08db3c

Please sign in to comment.