Commit 43a32c1a authored by Heiko Reese's avatar Heiko Reese
Browse files

Better error message on missing CN

parent 630620d1
Pipeline #104215 passed with stage
in 28 seconds
......@@ -69,14 +69,14 @@ var requestCmd = &cobra.Command{
// check cn
if viper.GetString("cn") == "" {
log.Fatal("Please specify a common name (»CN«)")
log.Fatal("Please specify a common name (»CN«) via --cn")
// clean up CommonName
cnCleanUp := strings.NewReplacer("Ä", "Ae", "Ö", "Oe", "Ü", "Ue", "ä", "ae", "ö", "oe", "ü", "ue", "ß", "ss")
commonName = viper.GetString("cn")
commonNameCleaned := cnCleanUp.Replace(commonName)
if commonNameCleaned != viper.GetString("cn") {
if commonNameCleaned != commonName {
log.Printf("Transcribed illegal characters in cn »%s«: »%s«", commonName, commonNameCleaned)
viper.Set("cn", commonNameCleaned)
commonName = commonNameCleaned
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment