code: func certNames(cert *x509.Certificate) []string {
  	var names []string
  	if cert.Subject.CommonName != "" {
  		names = append(names, cert.Subject.CommonName)
  	}
  	names = append(names, cert.DNSNames...)
  	names = core.UniqueLowerNames(names)
  	for i, n := range names {
  		names[i] = replaceInvalidUTF8([]byte(n))
  	}
  	return names
  }
docs: // certNames collects up all of a certificate's subject names (Subject CN and
  // Subject Alternate Names) and reduces them to a unique, sorted set, typically for an
  // error message