diff --git a/main.go b/main.go index 0e766b5..d39e3d0 100644 --- a/main.go +++ b/main.go @@ -160,11 +160,11 @@ func (m *mkcert) makeCert(hosts []string) { privDER, err := x509.MarshalPKCS8PrivateKey(priv) fatalIfErr(err, "failed to encode certificate key") err = ioutil.WriteFile(filename+"-key.pem", pem.EncodeToMemory( - &pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0644) + &pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0400) fatalIfErr(err, "failed to save certificate key") err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory( - &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0600) + &pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644) fatalIfErr(err, "failed to save certificate key") log.Printf("\nCreated a new certificate valid for the following names 📜")