Simplify verification of hostname in ssl certificates

This commit is contained in:
Manuel de Brito Fontes 2017-08-09 23:27:57 -04:00
parent 198c926bb9
commit c3dd00c7b4
5 changed files with 7 additions and 130 deletions

View file

@ -1104,8 +1104,9 @@ func (ic *GenericController) createServers(data []interface{},
}
cert := bc.(*ingress.SSLCert)
if !isHostValid(host, cert) {
glog.Warningf("ssl certificate %v does not contain a common name for host %v", key, host)
err = cert.Certificate.VerifyHostname(host)
if err != nil {
glog.Warningf("ssl certificate %v does not contain a Common Name or Subject Alternative Name for host %v", key, host)
continue
}