Ver código fonte

Add a CommonName field to the CA to work-around iOS UI bug

Fixes #47
Filippo Valsorda 6 anos atrás
pai
commit
676d4cdf6b
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      cert.go

+ 5 - 0
cert.go

@@ -159,6 +159,11 @@ func (m *mkcert) newCA() {
 		Subject: pkix.Name{
 			Organization:       []string{"mkcert development CA"},
 			OrganizationalUnit: []string{userAndHostname},
+
+			// The CommonName is required by iOS to show the certificate in the
+			// "Certificate Trust Settings" menu.
+			// https://github.com/FiloSottile/mkcert/issues/47
+			CommonName: "mkcert " + userAndHostname,
 		},
 		SubjectKeyId: skid[:],