mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-13 16:31:41 +08:00
Support installing into Java's root store (#38)
This commit is contained in:

committed by
Filippo Valsorda

parent
fd504a1868
commit
ae768be874
22
main.go
22
main.go
@@ -105,6 +105,10 @@ func (m *mkcert) Run(args []string) {
|
||||
warning = true
|
||||
log.Printf("Warning: the local CA is not installed in the %s trust store! ⚠️", NSSBrowsers)
|
||||
}
|
||||
if hasJava && !m.checkJava() {
|
||||
warning = true
|
||||
log.Println("Warning: the local CA is not installed in the Java trust store! ⚠️")
|
||||
}
|
||||
if warning {
|
||||
log.Println("Run \"mkcert -install\" to avoid verification errors ‼️")
|
||||
}
|
||||
@@ -179,6 +183,15 @@ func (m *mkcert) install() {
|
||||
}
|
||||
printed = true
|
||||
}
|
||||
if hasJava && !m.checkJava() {
|
||||
if hasKeytool {
|
||||
m.installJava()
|
||||
log.Println("The local CA is now installed in Java's trust store! ☕️")
|
||||
} else {
|
||||
log.Println(`Warning: "keytool" is not available, so the CA can't be automatically installed in Java's trust store! ⚠️`)
|
||||
}
|
||||
printed = true
|
||||
}
|
||||
if printed {
|
||||
log.Print("")
|
||||
}
|
||||
@@ -195,6 +208,15 @@ func (m *mkcert) uninstall() {
|
||||
log.Print("")
|
||||
}
|
||||
}
|
||||
if hasJava {
|
||||
if hasKeytool {
|
||||
m.uninstallJava()
|
||||
} else {
|
||||
log.Print("")
|
||||
log.Println(`Warning: "keytool" is not available, so the CA can't be automatically uninstalled from Java's trust store (if it was ever installed)! ⚠️`)
|
||||
log.Print("")
|
||||
}
|
||||
}
|
||||
if m.uninstallPlatform() {
|
||||
log.Print("The local CA is now uninstalled from the system trust store(s)! 👋")
|
||||
log.Print("")
|
||||
|
Reference in New Issue
Block a user