Ubuntu 24.04
Sponsored Link

InfluxDB : Enable HTTPS2024/06/10

 
Enable HTTPS on InfluxDB server.
(used HTTP connection by default)
[1]
Get SSL Certificate, or Create self-signed Certificate.
It uses self signed Certificate on this example.
[2] Enable HTTPS.
root@dlp:~#
cp /etc/ssl/private/{server.crt,server.key} /etc/influxdb/

root@dlp:~#
chown influxdb:influxdb /etc/influxdb/{server.crt,server.key}

root@dlp:~#
vi /etc/influxdb/influxdb.conf
# line 257 : uncomment and change
https-enabled = true

# line 260 : uncomment and change to your certificate
https-certificate = "/etc/influxdb/server.crt"

# line 263 : uncomment and change to your certificate
https-private-key = "/etc/influxdb/server.key"

root@dlp:~#
systemctl restart influxdb
[3] Connect to InfluxDB from Clients via HTTPS like follows.
# on CLI connection, add [ssl] option
# if using valid certificate, specify the same hostname registered in certificate

root@dlp:~#
influx -host dlp.srv.world -ssl

Connected to https://dlp.srv.world:8086 version 1.6.7~rc0
InfluxDB shell version: 1.6.7~rc0
> exit

# for self signed certificate, add [-unsafeSsl] option

root@dlp:~#
influx -ssl -unsafeSsl

Connected to https://localhost:8086 version 1.6.7~rc0
InfluxDB shell version: 1.6.7~rc0
> exit

# HTTP API

root@dlp:~#
curl -G https://dlp.srv.world:8086/query?pretty=true -u admin:adminpassword --data-urlencode "q=show users"

{
    "results": [
        {
            "statement_id": 0,
            "series": [
.....
.....

# HTTP API (self signed)

root@dlp:~#
curl -k -G https://localhost:8086/query?pretty=true -u admin:adminpassword --data-urlencode "q=show users"

{
    "results": [
        {
            "statement_id": 0,
            "series": [
.....
.....
Matched Content