mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 00:41:40 +08:00

committed by
Filippo Valsorda

parent
5bb0c47df7
commit
66af5a51f6
@@ -125,6 +125,9 @@ mkcert supports the following root stores:
|
|||||||
-cert-file FILE, -key-file FILE, -p12-file FILE
|
-cert-file FILE, -key-file FILE, -p12-file FILE
|
||||||
Customize the output paths.
|
Customize the output paths.
|
||||||
|
|
||||||
|
-client
|
||||||
|
Generate a certificate for client authentication.
|
||||||
|
|
||||||
-ecdsa
|
-ecdsa
|
||||||
Generate a certificate with an ECDSA key.
|
Generate a certificate with an ECDSA key.
|
||||||
|
|
||||||
|
3
cert.go
3
cert.go
@@ -76,6 +76,9 @@ func (m *mkcert) makeCert(hosts []string) {
|
|||||||
tpl.DNSNames = append(tpl.DNSNames, h)
|
tpl.DNSNames = append(tpl.DNSNames, h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.client {
|
||||||
|
tpl.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}
|
||||||
|
}
|
||||||
|
|
||||||
// IIS (the main target of PKCS #12 files), only shows the deprecated
|
// IIS (the main target of PKCS #12 files), only shows the deprecated
|
||||||
// Common Name in the UI. See issue #115.
|
// Common Name in the UI. See issue #115.
|
||||||
|
8
main.go
8
main.go
@@ -44,6 +44,9 @@ const advancedUsage = `Advanced options:
|
|||||||
-cert-file FILE, -key-file FILE, -p12-file FILE
|
-cert-file FILE, -key-file FILE, -p12-file FILE
|
||||||
Customize the output paths.
|
Customize the output paths.
|
||||||
|
|
||||||
|
-client
|
||||||
|
Generate a certificate for client authentication.
|
||||||
|
|
||||||
-ecdsa
|
-ecdsa
|
||||||
Generate a certificate with an ECDSA key.
|
Generate a certificate with an ECDSA key.
|
||||||
|
|
||||||
@@ -67,6 +70,7 @@ func main() {
|
|||||||
uninstallFlag = flag.Bool("uninstall", false, "")
|
uninstallFlag = flag.Bool("uninstall", false, "")
|
||||||
pkcs12Flag = flag.Bool("pkcs12", false, "")
|
pkcs12Flag = flag.Bool("pkcs12", false, "")
|
||||||
ecdsaFlag = flag.Bool("ecdsa", false, "")
|
ecdsaFlag = flag.Bool("ecdsa", false, "")
|
||||||
|
clientFlag = flag.Bool("client", false, "")
|
||||||
helpFlag = flag.Bool("help", false, "")
|
helpFlag = flag.Bool("help", false, "")
|
||||||
carootFlag = flag.Bool("CAROOT", false, "")
|
carootFlag = flag.Bool("CAROOT", false, "")
|
||||||
certFileFlag = flag.String("cert-file", "", "")
|
certFileFlag = flag.String("cert-file", "", "")
|
||||||
@@ -95,7 +99,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
(&mkcert{
|
(&mkcert{
|
||||||
installMode: *installFlag, uninstallMode: *uninstallFlag,
|
installMode: *installFlag, uninstallMode: *uninstallFlag,
|
||||||
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag,
|
pkcs12: *pkcs12Flag, ecdsa: *ecdsaFlag, client: *clientFlag,
|
||||||
certFile: *certFileFlag, keyFile: *keyFileFlag, p12File: *p12FileFlag,
|
certFile: *certFileFlag, keyFile: *keyFileFlag, p12File: *p12FileFlag,
|
||||||
}).Run(flag.Args())
|
}).Run(flag.Args())
|
||||||
}
|
}
|
||||||
@@ -105,7 +109,7 @@ const rootKeyName = "rootCA-key.pem"
|
|||||||
|
|
||||||
type mkcert struct {
|
type mkcert struct {
|
||||||
installMode, uninstallMode bool
|
installMode, uninstallMode bool
|
||||||
pkcs12, ecdsa bool
|
pkcs12, ecdsa, client bool
|
||||||
keyFile, certFile, p12File string
|
keyFile, certFile, p12File string
|
||||||
|
|
||||||
CAROOT string
|
CAROOT string
|
||||||
|
Reference in New Issue
Block a user