The logic to check if the SSL private key is present looks to be inverted.
vanye ~/S/g/s/g/m/consul-cli ] ./consul-cli --consul 10.5.24.1:8500 --ssl --ssl-ca-cert ~/SRC/work/master/tls/biosphere/ssl/ca.pem --ssl-cert ~/SRC/work/master/tls/biosphere/ssl/client.crt --ssl-key ~/SRC/work/master/tls/biosphere/ssl/client.key --ssl-verify kv read /nats/endpoint
--ssl-key must be provided in order to use certificates for authentication
if c.sslCert != "" {
if c.sslKey != "" {
return nil, errors.New("--ssl-key must be provided in order to use certificates for authentication")
}
clientCert, err := tls.LoadX509KeyPair(c.sslCert, c.sslKey)
if err != nil {
return nil, err
}
tlsConfig.Certificates = []tls.Certificate{clientCert}
tlsConfig.BuildNameToCertificate()
}
However flipping the if c.sslKey logic still doesn't work.
The logic to check if the SSL private key is present looks to be inverted.
However flipping the
if c.sslKey
logic still doesn't work.