diff --git a/certificate/store.go b/certificate/store.go index 375068b..4e9dced 100644 --- a/certificate/store.go +++ b/certificate/store.go @@ -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") }