Skip to content

Commit

Permalink
remove strange condition
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshasselberg committed Sep 23, 2019
1 parent dbbc097 commit 4ce1363
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tlsutil/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (c *Configurator) check(config Config, pool *x509.CertPool, cert *tls.Certi
if pool == nil {
return fmt.Errorf("VerifyIncoming set, and no CA certificate provided!")
}
if cert == nil || cert.Certificate == nil {
if cert == nil {
return fmt.Errorf("VerifyIncoming set, and no Cert/Key pair provided!")
}
}
Expand Down Expand Up @@ -433,7 +433,7 @@ func (c *Configurator) commonTLSConfig(verifyIncoming bool) *tls.Config {
// connections without having a manual cert configured.
tlsConfig.GetCertificate = func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
cert := c.manual.cert
if cert == nil || cert.Certificate == nil {
if cert == nil {
cert = c.autoEncrypt.cert
}

Expand All @@ -445,7 +445,7 @@ func (c *Configurator) commonTLSConfig(verifyIncoming bool) *tls.Config {
// if possible, otherwise default to the manually provisioned one.
tlsConfig.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {
cert := c.autoEncrypt.cert
if cert == nil || cert.Certificate == nil {
if cert == nil {
cert = c.manual.cert
}

Expand Down

0 comments on commit 4ce1363

Please sign in to comment.