mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2026-02-14 17:49:58 +00:00
Remove the relationship between client authentication and the alternative ca cert bundle.
Client authentication isn't the only situation where you might want to override the system ca bundle with an alternative.
This commit is contained in:
@@ -262,14 +262,7 @@ func main() {
|
||||
kingpin.HelpFlag.Short('h')
|
||||
kingpin.Parse()
|
||||
|
||||
if *clientAuth {
|
||||
|
||||
cert, err := tls.LoadX509KeyPair(*certFile, *keyFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
certificates = append(certificates, cert)
|
||||
|
||||
if *caFile != "" {
|
||||
caCert, err := ioutil.ReadFile(*caFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
@@ -279,6 +272,14 @@ func main() {
|
||||
rootCAs.AppendCertsFromPEM(caCert)
|
||||
}
|
||||
|
||||
if *clientAuth {
|
||||
cert, err := tls.LoadX509KeyPair(*certFile, *keyFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
certificates = append(certificates, cert)
|
||||
}
|
||||
|
||||
tlsConfig = &tls.Config{
|
||||
InsecureSkipVerify: *insecure,
|
||||
Certificates: certificates,
|
||||
|
||||
Reference in New Issue
Block a user