Skip to content

Updated device_tracker.unifi documentation to cover the option 'verify_ssl'.#2263

Merged
fabaff merged 1 commit into
home-assistant:currentfrom
tchellomello:unifi_ssl
Mar 15, 2017
Merged

Updated device_tracker.unifi documentation to cover the option 'verify_ssl'.#2263
fabaff merged 1 commit into
home-assistant:currentfrom
tchellomello:unifi_ssl

Conversation

@tchellomello
Copy link
Copy Markdown
Contributor

Description:

Updated device_tracker.unifi documentation to cover the option 'verify_ssl'. If the SSL certificate is not imported on the system, the traceback below is displayed.

17-03-15 01:41:05 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.unifi
17-03-15 01:41:05 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform unifi
Traceback (most recent call last):
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib64/python3.5/ssl.py", line 377, in wrap_socket
    _context=self)
  File "/usr/lib64/python3.5/ssl.py", line 752, in __init__
    self.do_handshake()
  File "/usr/lib64/python3.5/ssl.py", line 988, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib64/python3.5/ssl.py", line 633, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 152, in async_setup_platform
    None, platform.get_scanner, hass, {DOMAIN: p_config})
  File "/usr/lib64/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib64/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/homeassistant/components/device_tracker/unifi.py", line 53, in get_scanner
    site_id=site_id, ssl_verify=verify_ssl)
  File "/opt/srv/homeassistant/.homeassistant/deps/pyunifi/controller.py", line 65, in __init__
    self._login(version)
  File "/opt/srv/homeassistant/.homeassistant/deps/pyunifi/controller.py", line 123, in _login
    r = self.session.post(login_url, params)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/sessions.py", line 535, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/opt/srv/homeassistant/.virtualenvs/hass_venv/lib/python3.5/site-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

The verify_ssl option was introduced to unifi by PR home-assistant/core#6490

@mention-bot
Copy link
Copy Markdown

@tchellomello, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kk7ds, @fabaff and @arsaboo to be potential reviewers.

Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🐦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants