Support wildcards
For example, if you're watching subdomain.example.com, a cert for *.example.com will now match.
This commit is contained in:
parent
4132ed5e9f
commit
65ed742477
|
@ -27,8 +27,16 @@ var watchDomains []string
|
||||||
var watchDomainSuffixes []string
|
var watchDomainSuffixes []string
|
||||||
|
|
||||||
func addWatchDomain (domain string) {
|
func addWatchDomain (domain string) {
|
||||||
watchDomains = append(watchDomains, strings.ToLower(domain))
|
domain = strings.ToLower(domain)
|
||||||
watchDomainSuffixes = append(watchDomainSuffixes, "." + strings.ToLower(domain))
|
|
||||||
|
watchDomains = append(watchDomains, domain)
|
||||||
|
watchDomainSuffixes = append(watchDomainSuffixes, "." + domain)
|
||||||
|
|
||||||
|
if dot := strings.IndexRune(domain, '.'); dot != -1 {
|
||||||
|
// also look for wildcard names that could match
|
||||||
|
// TODO: support exotic wildcards (wildcards besides "*.<DOMAIN>") in case there are CAs that issue them (there are) and clients that support them (less clear)
|
||||||
|
watchDomains = append(watchDomains, "*" + domain[dot:])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setWatchDomains (domains []string) error {
|
func setWatchDomains (domains []string) error {
|
||||||
|
|
Loading…
Reference in New Issue