mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 00:41:40 +08:00
Prevent IPv6 certs from ending up with hidden filenames
This commit is contained in:
2
main.go
2
main.go
@@ -152,7 +152,7 @@ func (m *mkcert) makeCert(hosts []string) {
|
|||||||
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
|
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
|
||||||
fatalIfErr(err, "failed to generate certificate")
|
fatalIfErr(err, "failed to generate certificate")
|
||||||
|
|
||||||
filename := strings.Replace(hosts[0], ":", ".", -1)
|
filename := strings.Replace(hosts[0], ":", "_", -1)
|
||||||
if len(hosts) > 1 {
|
if len(hosts) > 1 {
|
||||||
filename += "+" + strconv.Itoa(len(hosts)-1)
|
filename += "+" + strconv.Itoa(len(hosts)-1)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user