apply default certificate again in cases of invalid or incomplete cert config
Signed-off-by: Kamil Domański <kamil@domanski.co>
This commit is contained in:
parent
19d596b72b
commit
5c8522cdab
2 changed files with 3 additions and 6 deletions
|
@ -1115,6 +1115,7 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
tlsSecretName := extractTLSSecretName(host, ing, n.store.GetLocalSSLCert)
|
||||
if tlsSecretName == "" {
|
||||
klog.V(3).Infof("Host %q is listed in the TLS section but secretName is empty. Using default certificate.", host)
|
||||
servers[host].SSLCert = n.getDefaultSSLCertificate()
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1122,6 +1123,7 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
cert, err := n.store.GetLocalSSLCert(secrKey)
|
||||
if err != nil {
|
||||
klog.Warningf("Error getting SSL certificate %q: %v. Using default certificate", secrKey, err)
|
||||
servers[host].SSLCert = n.getDefaultSSLCertificate()
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1136,6 +1138,7 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
klog.Warningf("SSL certificate %q does not contain a Common Name or Subject Alternative Name for server %q: %v",
|
||||
secrKey, host, err)
|
||||
klog.Warningf("Using default certificate")
|
||||
servers[host].SSLCert = n.getDefaultSSLCertificate()
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1155,12 +1155,6 @@ func buildHTTPSListener(t interface{}, s interface{}) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
/*
|
||||
if server.SSLCert == nil && server.Hostname != "_" {
|
||||
return ""
|
||||
}
|
||||
*/
|
||||
|
||||
co := commonListenOptions(tc, hostname)
|
||||
|
||||
addrV4 := []string{""}
|
||||
|
|
Loading…
Reference in a new issue