Skip to content

Commit

Permalink
Merge pull request kubernetes#992 from aledbf/fix-nil-ssl
Browse files Browse the repository at this point in the history
Check errors generating pem files
  • Loading branch information
aledbf authored Jul 18, 2017
2 parents 6f07f3b + bd62135 commit bfd60ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/pkg/ingress/controller/backend_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@ func (ic *GenericController) getPemCertificate(secretName string) (*ingress.SSLC
var s *ingress.SSLCert
if okcert && okkey {
s, err = ssl.AddOrUpdateCertAndKey(nsSecName, cert, key, ca)
if err != nil {
return nil, fmt.Errorf("unexpected error creating pem file %v", err)
}
glog.V(3).Infof("found certificate and private key, configuring %v as a TLS Secret (CN: %v)", secretName, s.CN)
} else if ca != nil {
glog.V(3).Infof("found only ca.crt, configuring %v as an Certificate Authentication secret", secretName)
s, err = ssl.AddCertAuth(nsSecName, ca)
if err != nil {
return nil, fmt.Errorf("unexpected error creating pem file %v", err)
}
} else {
return nil, fmt.Errorf("no keypair or CA cert could be found in %v", secretName)
}
Expand Down

0 comments on commit bfd60ac

Please sign in to comment.