mirror of
https://github.com/niusmallnan/steve.git
synced 2025-09-19 08:53:54 +00:00
Don't append CA if url is behind public CA
This commit is contained in:
@@ -26,10 +26,12 @@ func ListenAndServe(ctx context.Context, url string, caCert []byte, token string
|
|||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
}
|
}
|
||||||
} else if len(caCert) > 0 {
|
} else if len(caCert) > 0 {
|
||||||
pool := x509.NewCertPool()
|
if _, err := http.Get(url); err != nil {
|
||||||
pool.AppendCertsFromPEM(caCert)
|
pool := x509.NewCertPool()
|
||||||
dialer.TLSClientConfig = &tls.Config{
|
pool.AppendCertsFromPEM(caCert)
|
||||||
RootCAs: pool,
|
dialer.TLSClientConfig = &tls.Config{
|
||||||
|
RootCAs: pool,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user