Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-Signed SSL certs not working #16

Open
InstigatorX opened this issue May 3, 2022 · 3 comments
Open

Self-Signed SSL certs not working #16

InstigatorX opened this issue May 3, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@InstigatorX
Copy link

Could you provide an option to support self signed SSL certificates? I'm now using openssl 1.1.1 to address the "x509: certificate relies on legacy Common Name field", but now get "x509: certificate signed by unknown authority".

@InstigatorX
Copy link
Author

Found this...

https://github.com/influxdata/influxdb-client-go

client := influxdb2.NewClientWithOptions("http://localhost:8086", "my-token",
influxdb2.DefaultOptions().
SetUseGZip(true).
SetTLSConfig(&tls.Config{
InsecureSkipVerify: true,
}))

@InstigatorX
Copy link
Author

I hacked the main.go to add...

import

"crypto/tls"

line 144...

options := influxdb2.DefaultOptions()
options.SetTLSConfig(&tls.Config{InsecureSkipVerify: true})
influxClient := influxdb2.NewClientWithOptions(config.InfluxServer, authString, options)

@cdzombak
Copy link
Owner

cdzombak commented May 3, 2022

Hm. It's true Golang will not trust self-signed certs by default. Passing InsecureSkipVerify is not recommended, as it downgrades the security for your connection such that it's effectively the same as using plain old HTTP.

This could be securely achieved by using a tls.Config which extends the default root store to include the self-signed cert in question, like described in this post. You could pass in the path to the certificate file as an optional flag when running the program, which would activate this code path.

I don't have the time to add this myself right now, but as I suppose some number of people who want to send their Ecobee data to Influx may be using self-signed certs, I would accept such a PR.

@cdzombak cdzombak added the bug Something isn't working label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants