code: func (cg configGroup) getConfig(name string) *Config {
  	name = strings.ToLower(name)
  
  	// exact match? great, let's use it
  	if config, ok := cg[name]; ok {
  		return config
  	}
  
  	// try replacing labels in the name with wildcards until we get a match
  	labels := strings.Split(name, ".")
  	for i := range labels {
  		labels[i] = "*"
  		candidate := strings.Join(labels, ".")
  		if config, ok := cg[candidate]; ok {
  			return config
  		}
  	}
  
  	// as last resort, try a config that serves all names
  	if config, ok := cg[""]; ok {
  		return config
  	}
  
  	return nil
  }
docs: // getConfig gets the config by the first key match for name.
  // In other words, "sub.foo.bar" will get the config for "*.foo.bar"
  // if that is the closest match. This function MAY return nil
  // if no match is found.
  //
  // This function follows nearly the same logic to lookup
  // a hostname as the getCertificate function uses.