code: func normalizeCSR(csr *x509.CertificateRequest, forceCNFromSAN bool) {
  	if forceCNFromSAN && csr.Subject.CommonName == "" {
  		if len(csr.DNSNames) > 0 {
  			csr.Subject.CommonName = csr.DNSNames[0]
  		}
  	} else if csr.Subject.CommonName != "" {
  		csr.DNSNames = append(csr.DNSNames, csr.Subject.CommonName)
  	}
  	csr.Subject.CommonName = strings.ToLower(csr.Subject.CommonName)
  	csr.DNSNames = core.UniqueLowerNames(csr.DNSNames)
  }
docs: // normalizeCSR deduplicates and lowers the case of dNSNames and the subject CN.
  // If forceCNFromSAN is true it will also hoist a dNSName into the CN if it is empty.