If I try using the internal IP address in the config file, like so:
ha_url = https://192.168.x.x:8123
I get the expected, “hostname does not match SSL hostname” error:
2017-05-03 17:06:59.780486 WARNING ------------------------------------------------------------
2017-05-03 17:07:04.793557 DEBUG get_ha_config()
2017-05-03 17:07:05.111598 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:05.112155 WARNING ------------------------------------------------------------
2017-05-03 17:07:05.112567 WARNING Unexpected error:
2017-05-03 17:07:05.113027 WARNING ------------------------------------------------------------
2017-05-03 17:07:05.114654 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
_match_hostname(cert, self.assert_hostname or hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
match_hostname(cert, asserted_hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
% (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
ha_config = ha.get_ha_config()
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
r = requests.get(apiurl, headers=headers, verify=conf.certpath)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
2017-05-03 17:07:05.115544 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.128854 DEBUG get_ha_config()
2017-05-03 17:07:10.420095 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:10.420773 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.421306 WARNING Unexpected error:
2017-05-03 17:07:10.421774 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.423382 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
_match_hostname(cert, self.assert_hostname or hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
match_hostname(cert, asserted_hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
% (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
ha_config = ha.get_ha_config()
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
r = requests.get(apiurl, headers=headers, verify=conf.certpath)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
2017-05-03 17:07:10.424171 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.437447 DEBUG get_ha_config()
2017-05-03 17:07:15.749283 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:15.749963 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.750502 WARNING Unexpected error:
2017-05-03 17:07:15.750971 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.752584 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
_match_hostname(cert, self.assert_hostname or hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
match_hostname(cert, asserted_hostname)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
% (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
ha_config = ha.get_ha_config()
File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
r = requests.get(apiurl, headers=headers, verify=conf.certpath)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'