mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
merge system cert pool with own certs (#2226)
This commit is contained in:
parent
e5fe74ce77
commit
025f14f879
3 changed files with 21 additions and 3 deletions
|
@ -133,7 +133,13 @@ func (l *LocalApiClientCfg) Load() error {
|
|||
return errors.Wrapf(err, "failed to load cacert")
|
||||
}
|
||||
|
||||
caCertPool := x509.NewCertPool()
|
||||
caCertPool, err := x509.SystemCertPool()
|
||||
if err != nil {
|
||||
log.Warningf("Error loading system CA certificates: %s", err)
|
||||
}
|
||||
if caCertPool == nil {
|
||||
caCertPool = x509.NewCertPool()
|
||||
}
|
||||
caCertPool.AppendCertsFromPEM(caCert)
|
||||
apiclient.CaCertPool = caCertPool
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue