Camera Combined custom component - SSL error

I’m trying to get the custom component of camera.combined to work, but I keep running into an SSL error. I am utilizing an SSL certificate on my main configuration Any idea how I can fix this?

@ludeeus - tagging you as you seem to be the author of this component.

Thanks!

SSL config from configuration.yaml:

http:
  ssl_certificate: /ssl/ha.crt
  ssl_key: /ssl/ha.key

Here is the error from home-assistant.log

2019-02-27 14:24:20 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.6/ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "/usr/local/lib/python3.6/ssl.py", line 814, in __init__
    self.do_handshake()
  File "/usr/local/lib/python3.6/ssl.py", line 1068, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/local/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='***.***.***', port=8123): Max retries exceeded with url: /api/camera_proxy/camera.front_yard?token=04465e4d6436b8ae00442153c15d42adf5f5250c27893d0bbb459375e7ba49bd (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 67, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 99, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 118, in handle
    result = await result
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 407, in get
    return await self.handle(request, camera)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 443, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 303, in handle_async_mjpeg_stream
    request, self.frame_interval)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 293, in handle_async_still_stream
    self.content_type, interval)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 131, in async_get_still_stream
    img_bytes = await image_cb()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/combined/camera.py", line 61, in camera_image
    feed = requests.get(self._base_address + attribute).content
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='***.***.***', port=8123): Max retries exceeded with url: /api/camera_proxy/camera.front_yard?token=04465e4d6436b8ae00442153c15d42adf5f5250c27893d0bbb459375e7ba49bd (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))

Like with any custom component you should open an issue in the repo you found it :slight_smile:

https://github.com/custom-components/camera.combined/issues

When you do, also include the configuration for the component itself

Good call - ill place it there :slight_smile: