InfluxDB : Enable HTTPS2024/08/26 |
|
Enable HTTPS on InfluxDB server. |
|
| [1] |
Get SSL Certificate, or
Create self-signed Certificate. |
| [2] | Enable HTTPS. |
|
root@dlp:~ # cp /usr/local/etc/ssl/server.crt /usr/local/etc/ssl/influxd.crt root@dlp:~ # cp /usr/local/etc/ssl/server.key /usr/local/etc/ssl/influxd.key root@dlp:~ # chown influxd:influxd /usr/local/etc/ssl/influxd.crt /usr/local/etc/ssl/influxd.key
root@dlp:~ #
vi /usr/local/etc/influxd.conf # line 309 : uncomment and change https-enabled = true # line 312 : uncomment and change to your certificate https-certificate = "/usr/local/etc/ssl/influxd.crt" # line 315 : uncomment and change to your certificate https-private-key = "/usr/local/etc/ssl/influxd.key"root@dlp:~ # service influxd restart
|
| [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://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> exit
# for self signed certificate, add [-unsafeSsl] option root@dlp:~ # influx -ssl -unsafeSsl
Connected to https://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> 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": [
.....
.....
|
| Sponsored Link |