Skip to content

Commit

Permalink
#144 detect blocking call to load_default_certs
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyuentuen committed Sep 12, 2024
1 parent c52ab77 commit 07e0603
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom_components/alfen_wallbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from .alfen import AlfenDevice
from .const import DOMAIN, TIMEOUT
from homeassistant.util.ssl import get_default_context, get_default_no_verify_context

PLATFORMS = [
Platform.SENSOR,
Expand Down
8 changes: 5 additions & 3 deletions custom_components/alfen_wallbox/alfen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import datetime
import json
import logging
import ssl
from ssl import CERT_NONE


from aiohttp import ClientResponse
from urllib3 import disable_warnings

from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util.ssl import get_default_context, get_default_no_verify_context

from .const import (
ALFEN_PRODUCT_MAP,
Expand Down Expand Up @@ -94,10 +96,10 @@ def __init__(self,
disable_warnings()

# Default ciphers needed as of python 3.10
context = ssl.create_default_context()
context = get_default_context()
context.set_ciphers("DEFAULT")
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
context.verify_mode = CERT_NONE
self.ssl = context

async def init(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alfen_wallbox/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
COMMAND_REBOOT = "reboot"

INTERVAL = 5
TIMEOUT = 20
TIMEOUT = 15

SERVICE_REBOOT_WALLBOX = "reboot_wallbox"
SERVICE_SET_CURRENT_LIMIT = "set_current_limit"
Expand Down

0 comments on commit 07e0603

Please sign in to comment.