certificate.Store: Check '*' scope last
This commit is contained in:
parent
3c9c087a25
commit
f6bccb156a
@ -82,10 +82,6 @@ func (s *Store) Get(hostname string) (*tls.Certificate, error) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
cert, ok := s.certs[hostname]
|
||||
if !ok {
|
||||
// Try "*"
|
||||
cert, ok = s.certs["*"]
|
||||
}
|
||||
if !ok {
|
||||
// Try wildcard
|
||||
wildcard := strings.SplitN(hostname, ".", 2)
|
||||
@ -94,6 +90,10 @@ func (s *Store) Get(hostname string) (*tls.Certificate, error) {
|
||||
cert, ok = s.certs[hostname]
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
// Try "*"
|
||||
cert, ok = s.certs["*"]
|
||||
}
|
||||
if !ok {
|
||||
return nil, errors.New("unrecognized scope")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user