code: func MatchDomain(domain string, certDomain string) bool {
  	if domain == certDomain {
  		return true
  	}
  
  	for len(certDomain) > 0 && certDomain[len(certDomain)-1] == '.' {
  		certDomain = certDomain[:len(certDomain)-1]
  	}
  
  	labels := strings.Split(domain, ".")
  	for i := range labels {
  		labels[i] = "*"
  		candidate := strings.Join(labels, ".")
  		if certDomain == candidate {
  			return true
  		}
  	}
  	return false
  }
docs: // MatchDomain return true if a domain match the cert domain