matt-FFFFFF/hassio-addon-teslamate

SSL handshake error for http://localhost

driehle opened this issue · 1 comments

I followed the install guide, but the addon fails to start. The following is writte in the logs:

[16:05:45] INFO: Finished Importing Grafana Dashboards
2022-09-28 16:05:46.719 [info] Migrations already up
2022-09-28 16:05:48.755 [info] System Info: Erlang/OTP 24 (jit)
2022-09-28 16:05:48.755 [info] Version: 1.27.1
2022-09-28 16:05:48.784 [info] Running TeslaMateWeb.Endpoint with cowboy 2.9.0 at :::4000 (http)
2022-09-28 16:05:48.785 [info] Access TeslaMateWeb.Endpoint at http://localhost
2022-09-28 16:05:48.828 [notice] TLS :client: In state :wait_cert_cr at ssl_handshake.erl:2084 generated CLIENT ALERT: Fatal - Handshake Failure
 - {:bad_cert, :hostname_check_failed}
2022-09-28 16:05:48.828 [error] GenServer {Tortoise.Registry, {Tortoise.Connection, "TESLAMATE_302E3831383"}} terminating
** (stop) {:tls_alert, {:handshake_failure, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:2084 generated CLIENT ALERT: Fatal - Handshake Failure\n {bad_cert,hostname_check_failed}'}}
Last message: :connect
<<< the 7 lines above are repeated several times >>>
2022-09-28 16:05:49.078 [notice] Application teslamate exited: shutdown
{"Kernel pid terminated",application_controller,"{application_terminated,teslamate,shutdown}"}
Kernel pid terminated (application_controller) ({application_terminated,teslamate,shutdown})
Crash dump is being written to: erl_crash.dump...done
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

I am using HA with the Let's Encrypt addon and an appropriate domain name, i.e. my instance is not accesses via http://localhost. Could it be that this is causing troubles here? Obviously, the name "localhost" is not among the valid DNS names in the certificate I am using.

Any ideas how to solve this?

I mistook this for an API error, however the error was in the communication with MQTT (teslamate#1222 gave me the idea). Basically, setting mqtt_tls_accept_invalid_certs: true for the Teslamate addon did the trick.