InfluxDB with SSL

I run my InfluxDB server on a different machine and I’m looking to add SSL to the communication link between the two systems.

I can use this setup just fine:

influxdb:
  host: 192.168.1.1
  port: 8086
  username: homeassistant
  password: "password"
  database: home_assistant
  ssl: false
  verify_ssl: false

I want to move it behind traefik with https and just putting it on 443. I have another device connecting to the host address below, so I know it is possible to talk with influx at that address.

This won’t connect:

influxdb:
  host: influx0.domain.com OR https://influx0.domain.com
  port: 443
  username: homeassistant
  password: "password"
  database: home_assistant
  ssl: true
  verify_ssl: false

It gives various connection errors.
I’m hoping there is a formatting issue with the hostname that will fix my issue. I just couldn’t find any examples of people using a full domain name.

Yeah I’m stuck too. All guides I find just skip SSL. I have no idea what host names to use in configuration.yaml, and in grafana webUI etc

I believe I was fighting a Traefik issue. I got it working last week but can’t recall the exact problem. Here is my config though.

influxdb:
  host: influx0.domain.com
  port: 443
  username: homeassistant
  password: "password"
  database: home_assistant
  ssl: true

I also noticed that in general moving the movement from http to https requires resetting lots of parts of the connection chain. A lot of tools and apps aren’t really happy to switch between those two things.
Also, check your firewall to make sure you’re not blocking that port. Didn’t apply to me here as they are on the same VLAN and same machine. But it did get me with another service.

Ah, now I remember thanks to my command line history.
hassio (or whatever the new name is for the hypervisor) might be trying to ‘help’ you out with your DNS.

I’m sure there is a good reason but I found it quite annoying. These services are only available inside my network. I achieve ssl by using DNS based challenge via cloudflare (which doesn’t require opening up ports) and Traefik. Then my pfsense box takes an DNS requests for influx0.domain.com and points it at my internal server. Works really well unless something like hassio is telling it to use 1.1.1.1 for DNS instead. Which was trying to hit my server from outside the network.

I found this by getting to a command prompt where the app is running, which will be the docker instance if you’re running hassio. Then runningcurl -v https://influx0.domain.com That showed me that it wasn’t resolving to my internal network.