-
Notifications
You must be signed in to change notification settings - Fork 127
Add support for custom CAs for TLS validation in clients #847
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
Conversation
🌐 Coverage report
|
internal/certs/pool.go
Outdated
| // PoolWithCACertificate returns a new pool that includes the CA certificate | ||
| // in the given path. | ||
| func PoolWithCACertificate(path string) (*x509.CertPool, error) { | ||
| pool := x509.NewCertPool() | ||
| err := addCACertificateToPool(pool, path) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return pool, nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question Currently, it is just being used the function related to the system certs pool. Should this one be kept too? It's true that it could allow us to test just a subset of CAs in case it is needed easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only few nit-picks, nothing blocking
| } | ||
|
|
||
| // Address option sets the host to use to connect to Kibana. | ||
| func Address(address string) ClientOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that this function will be used in the original PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for completitude, this is only used on tests by now https://github.com/elastic/elastic-package/pull/847/files/bff27e46db7e789f768740b4a4b18cc7c403793b#diff-9c4e0882a886054c20aa4c09e6c0e667826fd54b97f98e5ec36066eb0798feb8R30
| @@ -0,0 +1,5 @@ | |||
| -----BEGIN EC PRIVATE KEY----- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop a CONTRIBUTING.md with instructions to generate those :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added as comment in the tests.
|
Thanks for the reviews! Comments addressed, ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Initially implemented as part of #789, moved to a separate PR for clarity.
Add support for custom CAs for TLS in clients for Elasticsearch and Kibana.
Include helpers to create certificate pools that include a given CA certificate file.
Related to #654.