Skip to content

Instantly share code, notes, and snippets.

@xNok

xNok/influxdb.go Secret

Created September 13, 2021 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xNok/4c91576cf608b4417ecf2cb29b7e74a5 to your computer and use it in GitHub Desktop.
Save xNok/4c91576cf608b4417ecf2cb29b7e74a5 to your computer and use it in GitHub Desktop.
// read the certificate
cer, _ := tls.LoadX509KeyPair("server.crt", "server.key")
// define the certificate
client := influxdb2.NewClientWithOptions(dbURL, dbToken,
influxdb2.DefaultOptions().
SetTLSConfig(&tls.Config{
Certificates: []tls.Certificate{cer}
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment