-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why subject doesn't contain CN for generated certs? #205
Comments
Common Name has been deprecated for about 20 years, and is now ignored by major X.509 verifiers. It's an overloaded unconstrained field that should stop being used for web certificates. Unfortunately, IIS and iOS use it in their UIs, so mkcert sets it in the root and in PKCS#12 certificates. |
@FiloSottile Would you accept a PR to add CN if the user needs it or is that out of scope for this project and the direction it wants to head in? My use-case:- I'm writing tests and used this amazing utility to create test certs. My production certs have a |
Unfortunately, making the certificates look like production certificates is out of scope. The CN is a fairly small change, but mkcert certificates are pretty opinionated, and mkcert would have to grow a large number of config options to allow everyone to make certificates similar to those they already have. I have seen a few forks made in these situations, and I think that's the way to go, as it gives you complete control over how the certificates look like. |
I was hoping to switch from my stack of incomprehensible It is impossible to use I appreciate that this is an opinionated tool, and you do not want to support this feature. But I figured maybe this was a use of cn you were not aware of. I will return to my nightmare stack of openssl commands. |
"Common Name has been deprecated for about 20 years, and is now ignored by major X.509 verifiers. "
curl, chrome and lot of program havent yet received the mkcert's service note. In additionnaly, we install the ROOT certificate in the system store to able to suppress SSL errors. Windows alternative with valid certificate! :) OMG.... choco install openssl
choco upgrade openssl
$domain="mydomain.local"
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "$($domain).key" -out "$($domain).crt" -subj "/CN=$($domain)." -addext "subjectAltName=DNS:$($domain),DNS:*.$($domain),IP:127.0.0.1"
Import-Certificate -FilePath .\$($domain).crt -CertStoreLocation Cert:\CurrentUser\Root |
The typical generated cert via mkcert has subject as:-
While most web certs also have a CommonName attribute.
Is there a reason behind this design choice?
I can see that CommonName is ignored while creating the cert.
mkcert/cert.go
Lines 61 to 64 in df15e0c
Later, for PKCS#12, there's a CommonName added but not for usual default options, why?
The text was updated successfully, but these errors were encountered: