Add user/pass authentication from Telegraf

Hello,

I have a working Telegraf system that obtain data from MQTT broker and send it to InlfuxDB.

I have configured this way the InfluxDB output:

[[outputs.influxdb]]
  urls = ["http://influxdb:8086"]
  database = "sensors"
  skip_database_creation = false
  username = "myuser"
  password = "mypass"
  user_agent = "telegraf"

The problem is that in the influxdb side, there no username configured:

# influx
Connected to http://localhost:8086 version 1.8.0
InfluxDB shell version: 1.8.0
> show databases;
name: databases
name
----
_internal
sensors
> use sensors
Using database sensors
> show users
user admin
---- -----
> 

The problem is that the traffic from Telegraf to InfluxDB goes across Internet.

I want to secure as much as possible the traffic, how could I add user/pass authentication? Could I add a TLS connection between Telegraf and InfluxDB?

Thanks for your help.

Have you read:

https://docs.influxdata.com/influxdb/v1.8/administration/authentication_and_authorization

and

Antony.