Skip to content

Commit

Permalink
try explicitly asking for system cas?
Browse files Browse the repository at this point in the history
  • Loading branch information
waisbrot committed Dec 27, 2023
1 parent c0e0f8c commit 0e66f56
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion metrics/influx.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package metrics
import (
"context"
"crypto/tls"
"crypto/x509"
"time"

influxdb "github.com/influxdata/influxdb-client-go/v2"
@@ -17,7 +18,15 @@ var invokeTime time.Time

func initInflux() {
influxClient = influxdb.NewClient(viper.GetString("influx.url"), viper.GetString("influx.token"))
influxdb.DefaultOptions().AddDefaultTag("application", "birdweather_digest").SetTLSConfig(&tls.Config{InsecureSkipVerify: true})
rootCas, err := x509.SystemCertPool()
if err != nil {
panic(err)
}
config := &tls.Config{
RootCAs: rootCas,
InsecureSkipVerify: true,
}
influxdb.DefaultOptions().AddDefaultTag("application", "birdweather_digest").SetTLSConfig(config)
writeAPI = influxClient.WriteAPIBlocking(viper.GetString("influx.org"), viper.GetString("influx.bucket"))
produceMetrics = true
}

0 comments on commit 0e66f56

Please sign in to comment.