mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-13 16:31:41 +08:00
8
cert.go
8
cert.go
@@ -25,7 +25,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"software.sslmate.com/src/go-pkcs12"
|
||||
pkcs12 "software.sslmate.com/src/go-pkcs12"
|
||||
)
|
||||
|
||||
var userAndHostname string
|
||||
@@ -73,6 +73,12 @@ func (m *mkcert) makeCert(hosts []string) {
|
||||
}
|
||||
}
|
||||
|
||||
// IIS (the main target of PKCS #12 files), only shows the deprecated
|
||||
// Common Name in the UI. See issue #115.
|
||||
if m.pkcs12 {
|
||||
tpl.Subject.CommonName = hosts[0]
|
||||
}
|
||||
|
||||
pub := priv.PublicKey
|
||||
cert, err := x509.CreateCertificate(rand.Reader, tpl, m.caCert, &pub, m.caKey)
|
||||
fatalIfErr(err, "failed to generate certificate")
|
||||
|
Reference in New Issue
Block a user