You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As a user of TLSSetting, I want an option to allow appending ca certs on top of the system certs pool. Today, if the user specify any CA file for TLSSetting it will only use that.
The background is the the application our exporter calls can have either cacert that is well known(e.g: Digi cert that is available in os) or private(e.g: Splunk CMP stack). We want the exporter to be able to communicate to both.
Describe the solution you'd like
Add a new config option in TLSSetting
type TLSSetting struct {
UseSystemCACerts bool
}
when loading ca cert:
func (c TLSSetting) loadCert(caPath string) (*x509.CertPool, error) {
caPEM, err := os.ReadFile(filepath.Clean(caPath))
if err != nil {
return nil, fmt.Errorf("failed to load CA %s: %w", caPath, err)
}
var certPool *x509.CertPool
if c.UseSystemCACerts {
certPool, _ = x509.SystemCertPool()
}
if certPool == nil {
certPool = x509.NewCertPool()
}
if !certPool.AppendCertsFromPEM(caPEM) {
return nil, fmt.Errorf("failed to parse CA %s", caPath)
}
return certPool, nil
}
Describe alternatives you've considered
An alternative is to always load system certs in the ca pool. However, this would increase HTTPs traffic payload for everyone
Additional context
N/A
The text was updated successfully, but these errors were encountered:
**Description:**
Add `include_system_ca_certs_pool` to configtls, allowing to load system
certs and additional custom certs.
**Link to tracking Issue:**
Fixes#7774
Is your feature request related to a problem? Please describe.
As a user of
TLSSetting
, I want an option to allow appending ca certs on top of the system certs pool. Today, if the user specify any CA file forTLSSetting
it will only use that.The background is the the application our exporter calls can have either cacert that is well known(e.g: Digi cert that is available in os) or private(e.g: Splunk CMP stack). We want the exporter to be able to communicate to both.
Describe the solution you'd like
Add a new config option in
TLSSetting
when loading ca cert:
Describe alternatives you've considered
An alternative is to always load system certs in the ca pool. However, this would increase HTTPs traffic payload for everyone
Additional context
N/A
The text was updated successfully, but these errors were encountered: