sensu / sensu-influxdb-handler

Sensu Go InfluxDB Metrics Handler
https://sensu.io
MIT License
14 stars 16 forks source link

x509: certificate signed by unknown authority #17

Closed smilo closed 5 years ago

smilo commented 5 years ago

Hello and thanks for the great work. I got an issue,I run influxdb in a container, configured with https enabled and self-singed certificates. When sensu-influxdb-handler( v3.0.2 ) tries to connect to the influxdb I get this error "x509: certificate signed by unknown authority". I assume that I get this cause the cert is self-signed. Is there something like "skip_ssl_verification" option ?

nikkictl commented 5 years ago

Hey @smilo! Thanks for trying it out! That's a great question, and a very valid concern. The original implementation of the InfluxDB client was rather simple. However, I did take a look at the influx client code, and it appears like we are in luck, they support an InsecureSkipVerify option: https://github.com/influxdata/influxdb/blob/367328aa3eb74c86674a922eab54434ccda3d570/client/v2/client.go#L43-L45.

We can implement that flag in the handler and pass it on to the influx client 😄