Camera: Generic no longer working mentions SSL (error log included)

O/S: Windows 7 (I know, sorry)
Python: Python 3.6.4

anything else, let me know.

OK, so my knowledge is limited so bear with me.

Story time (I’ll keep it short)

Installed appdaemon last night, as always a bit of a farce but I got it done, it won’t work (Windows 7 doesn’t have websockets or something) anyway, before I knew that I was messing about and I realised that my HA wasn’t protected by a password. so I uncommented the ‘api_password: !secret http_password’ line in the configuration.yaml, is this the reason I’m getting this error?

Log Details (ERROR)
Tue Apr 10 2018 18:12:43 GMT+0100 (GMT Daylight Time)

Error handling request
Traceback (most recent call last):
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\web_protocol.py", line 416, in start
    resp = yield from self._request_handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\web.py", line 325, in _handle
    resp = yield from handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\web_middlewares.py", line 93, in impl
    return (yield from handler(request))
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\http\static.py", line 68, in staticresource_middleware
    return await handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\http\real_ip.py", line 27, in real_ip_middleware
    return await handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\http\ban.py", line 68, in ban_middleware
    return await handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\http\auth.py", line 28, in auth_middleware
    return await handler(request)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\http\view.py", line 104, in handle
    result = await result
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\camera\__init__.py", line 379, in get
    response = yield from self.handle(request, camera)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\camera\__init__.py", line 399, in handle
    image = yield from camera.async_camera_image()
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\components\camera\generic.py", line 115, in async_camera_image
    websession = async_get_clientsession(self.hass)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\helpers\aiohttp_client.py", line 38, in async_get_clientsession
    hass.data[key] = async_create_clientsession(hass, verify_ssl)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\helpers\aiohttp_client.py", line 55, in async_create_clientsession
    connector = _async_get_connector(hass, verify_ssl)
  File "C:\Users\Lee\AppData\Local\Programs\Python\Python36-32\lib\site-packages\homeassistant\helpers\aiohttp_client.py", line 164, in _async_get_connector
    connector = aiohttp.TCPConnector(loop=hass.loop, ssl=ssl_context)
TypeError: __init__() got an unexpected keyword argument 'ssl'

Fixed it.

Found a post on Githut by a chap named ‘kirichkov’ This is his post.

It looks like the offending line is

home-assistant/homeassistant/helpers/aiohttp_client.py

Line 164 in 0081764

connector = aiohttp.TCPConnector(loop=hass.loop, ssl=ssl_context)
aiohttp doesn’t accept a ssl argument. When I changed ssl to ssl_context it started working, i.e.:

connector = aiohttp.TCPConnector(loop=hass.loop, ssl_context=ssl_context)
I hope someone more knowledgable with AIOHTTP than me reviews this and fixes it.

Hope that helps someone else.

I was about to link you there :slight_smile:

It seems a bunch of http-consuming components have been broken.

Hi, thanks for the fix, this linux python C stuff is killing me :slight_smile: