Make private keys writeable

Read-only is too much hassle for expendable dev keys
This commit is contained in:
Filippo Valsorda
2018-06-28 01:03:31 -04:00
parent d6aab07a4c
commit 7544098b30

View File

@@ -67,7 +67,7 @@ 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}), 0400)
&pem.Block{Type: "PRIVATE KEY", Bytes: privDER}), 0600)
fatalIfErr(err, "failed to save certificate key")
err = ioutil.WriteFile(filename+".pem", pem.EncodeToMemory(