Hide the CA path in normal operation
Most users don't need to interact with it, and it's important they don't share the rootCA-key.pem file, so let's not lead them there in the first place. Advanced users can still use "mkcert -CAROOT". Fixes #282
This commit is contained in:
parent
ea8260d0d9
commit
e8068235db
@ -4,12 +4,11 @@ mkcert is a simple tool for making locally-trusted development certificates. It
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ mkcert -install
|
$ mkcert -install
|
||||||
Created a new local CA at "/Users/filippo/Library/Application Support/mkcert" 💥
|
Created a new local CA 💥
|
||||||
The local CA is now installed in the system trust store! ⚡️
|
The local CA is now installed in the system trust store! ⚡️
|
||||||
The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊
|
The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊
|
||||||
|
|
||||||
$ mkcert example.com "*.example.com" example.test localhost 127.0.0.1 ::1
|
$ mkcert example.com "*.example.com" example.test localhost 127.0.0.1 ::1
|
||||||
Using the local CA at "/Users/filippo/Library/Application Support/mkcert" ✨
|
|
||||||
|
|
||||||
Created a new certificate valid for the following names 📜
|
Created a new certificate valid for the following names 📜
|
||||||
- "example.com"
|
- "example.com"
|
||||||
|
4
cert.go
4
cert.go
@ -261,8 +261,6 @@ func (m *mkcert) makeCertFromCSR() {
|
|||||||
func (m *mkcert) loadCA() {
|
func (m *mkcert) loadCA() {
|
||||||
if !pathExists(filepath.Join(m.CAROOT, rootName)) {
|
if !pathExists(filepath.Join(m.CAROOT, rootName)) {
|
||||||
m.newCA()
|
m.newCA()
|
||||||
} else {
|
|
||||||
log.Printf("Using the local CA at \"%s\" ✨\n", m.CAROOT)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
certPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, rootName))
|
certPEMBlock, err := ioutil.ReadFile(filepath.Join(m.CAROOT, rootName))
|
||||||
@ -341,7 +339,7 @@ func (m *mkcert) newCA() {
|
|||||||
&pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
|
&pem.Block{Type: "CERTIFICATE", Bytes: cert}), 0644)
|
||||||
fatalIfErr(err, "failed to save CA key")
|
fatalIfErr(err, "failed to save CA key")
|
||||||
|
|
||||||
log.Printf("Created a new local CA at \"%s\" 💥\n", m.CAROOT)
|
log.Printf("Created a new local CA 💥\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mkcert) caUniqueName() string {
|
func (m *mkcert) caUniqueName() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user