mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-13 16:31:41 +08:00
Put PKCS#12 behind a flag, and check in the vendored dependency
This commit is contained in:
7
main.go
7
main.go
@@ -34,6 +34,9 @@ const usage = `Usage of mkcert:
|
||||
$ mkcert '*.example.com'
|
||||
Generate "_wildcard.example.com.pem" and "_wildcard.example.com-key.pem".
|
||||
|
||||
$ mkcert -pkcs12 example.com
|
||||
Generate "example.com.p12" instead of a PEM file.
|
||||
|
||||
$ mkcert -uninstall
|
||||
Uninstall the local CA (but do not delete it).
|
||||
|
||||
@@ -45,6 +48,7 @@ func main() {
|
||||
log.SetFlags(0)
|
||||
var installFlag = flag.Bool("install", false, "install the local root CA in the system trust store")
|
||||
var uninstallFlag = flag.Bool("uninstall", false, "uninstall the local root CA from the system trust store")
|
||||
var pkcs12Flag = flag.Bool("pkcs12", false, "generate PKCS#12 instead of PEM")
|
||||
var carootFlag = flag.Bool("CAROOT", false, "print the CAROOT path")
|
||||
flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), usage) }
|
||||
flag.Parse()
|
||||
@@ -59,7 +63,7 @@ func main() {
|
||||
log.Fatalln("ERROR: you can't set -install and -uninstall at the same time")
|
||||
}
|
||||
(&mkcert{
|
||||
installMode: *installFlag, uninstallMode: *uninstallFlag,
|
||||
installMode: *installFlag, uninstallMode: *uninstallFlag, pkcs12: *pkcs12Flag,
|
||||
}).Run(flag.Args())
|
||||
}
|
||||
|
||||
@@ -68,6 +72,7 @@ const keyName = "rootCA-key.pem"
|
||||
|
||||
type mkcert struct {
|
||||
installMode, uninstallMode bool
|
||||
pkcs12 bool
|
||||
|
||||
CAROOT string
|
||||
caCert *x509.Certificate
|
||||
|
Reference in New Issue
Block a user