mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 17:56:33 +00:00
Bugfix SSL settings on proxy (#288)
* Bugfix SSL settings on proxy * fix lint
This commit is contained in:
parent
d105552fa9
commit
1bdd3d88de
@ -77,9 +77,9 @@ class RestAPI(object):
|
||||
self.webapp.router.add_post('/homeassistant/start', api_hass.start)
|
||||
self.webapp.router.add_post('/homeassistant/check', api_hass.check)
|
||||
|
||||
def register_proxy(self, homeassistant, websession):
|
||||
def register_proxy(self, homeassistant):
|
||||
"""Register HomeAssistant API Proxy."""
|
||||
api_proxy = APIProxy(self.loop, homeassistant, websession)
|
||||
api_proxy = APIProxy(self.loop, homeassistant)
|
||||
|
||||
self.webapp.router.add_get(
|
||||
'/homeassistant/api/websocket', api_proxy.websocket)
|
||||
|
@ -16,11 +16,13 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class APIProxy(object):
|
||||
"""API Proxy for Home-Assistant."""
|
||||
|
||||
def __init__(self, loop, homeassistant, websession):
|
||||
def __init__(self, loop, homeassistant):
|
||||
"""Initialize api proxy."""
|
||||
self.loop = loop
|
||||
self.homeassistant = homeassistant
|
||||
self.websession = websession
|
||||
|
||||
# Use homeassistant websession to ignore SSL
|
||||
self.websession = homeassistant.websession
|
||||
|
||||
async def _api_client(self, request, path, timeout=300):
|
||||
"""Return a client request with proxy origin for Home-Assistant."""
|
||||
@ -109,7 +111,7 @@ class APIProxy(object):
|
||||
|
||||
try:
|
||||
client = await self.websession.ws_connect(
|
||||
url, heartbeat=60)
|
||||
url, heartbeat=60, verify_ssl=False)
|
||||
|
||||
# handle authentication
|
||||
for _ in range(2):
|
||||
|
@ -91,7 +91,7 @@ class HassIO(object):
|
||||
self.supervisor, self.snapshots, self.addons, self.host_control,
|
||||
self.updater)
|
||||
self.api.register_homeassistant(self.homeassistant)
|
||||
self.api.register_proxy(self.homeassistant, self.websession)
|
||||
self.api.register_proxy(self.homeassistant)
|
||||
self.api.register_addons(self.addons)
|
||||
self.api.register_security()
|
||||
self.api.register_snapshots(self.snapshots)
|
||||
|
Loading…
x
Reference in New Issue
Block a user