AllMatchingCertificates returns a list of all certificates that could be used to serve the given SNI name, including exact SAN matches and wildcard matches.
(name string)
| 384 | // be used to serve the given SNI name, including exact SAN matches and |
| 385 | // wildcard matches. |
| 386 | func (certCache *Cache) AllMatchingCertificates(name string) []Certificate { |
| 387 | // get exact matches first |
| 388 | certs := certCache.getAllMatchingCerts(name) |
| 389 | |
| 390 | // then look for wildcard matches by replacing each |
| 391 | // label of the domain name with wildcards |
| 392 | labels := strings.Split(name, ".") |
| 393 | for i := range labels { |
| 394 | labels[i] = "*" |
| 395 | candidate := strings.Join(labels, ".") |
| 396 | certs = append(certs, certCache.getAllMatchingCerts(candidate)...) |
| 397 | } |
| 398 | |
| 399 | return certs |
| 400 | } |
| 401 | |
| 402 | // SubjectIssuer pairs a subject name with an issuer ID/key. |
| 403 | type SubjectIssuer struct { |
nothing calls this directly
no test coverage detected