git » kxd » commit 352c4ea

kxgencert: Default -host to `localhost` instead of `*`

author Alberto Bertogli
2024-08-15 20:40:44 UTC
committer Alberto Bertogli
2024-09-08 09:33:09 UTC
parent e35f950a4e904151eddbe071b6381aca7a950ebd

kxgencert: Default -host to `localhost` instead of `*`

Certificates with a DNS name of `*` are invalid, so don't use them as the
default, and instead default to `localhost`.

Note that in practice the scripts used to generate the certs would have
enforced an actual hostname.

However, certificates generated before kxgencert existed did use `*`.

kxgencert/kxgencert.go +1 -1

diff --git a/kxgencert/kxgencert.go b/kxgencert/kxgencert.go
index e1f40a7..b69f6c1 100644
--- a/kxgencert/kxgencert.go
+++ b/kxgencert/kxgencert.go
@@ -18,7 +18,7 @@ import (
 )
 
 var (
-	host = flag.String("host", "*",
+	host = flag.String("host", "localhost",
 		"Hostnames/IPs to generate the certificate for (comma separated)")
 	validFor = flag.Duration("validfor", 24*time.Hour*365*10,
 		"How long will the certificate be valid for (default: 10y)")