FiloSottile / mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.
https://mkcert.dev
BSD 3-Clause "New" or "Revised" License
49.26k stars 2.55k forks source link

Expiration #343

Open lollita opened 3 years ago

lollita commented 3 years ago

Do it is possible to set custom expiration date?

ikeyan commented 3 years ago

https://github.com/FiloSottile/mkcert/blob/0a3190b1659e514d6e9b03eedfa25049d046000b/cert.go#L59-L62 expiration period is hardcoded here, and the comment tells the reason of the value.

ikeyan commented 3 years ago

if this is a feature request, maybe duplicate of https://github.com/FiloSottile/mkcert/issues/339.

andykais commented 3 years ago

maybe expose this as an option and if a user exceeds the macos maximum expiration date, log a warning? Also, I'll be honest I am new to certificates, but I think that a cert generated on linux or windows is not valid on mac, and vice versa because it is tied to a root cert that is specific to that OS. So if we detect what OS the cert is being generated for, we could avoid even logging that error for non-macs.

The big use case for me is distributing a localhost web app as a linux package. The certificate doesn't ever need to expire in that case, and it would be frustrating for users to see an error in their app that their cert expired 2 years later

prasanthbazz commented 3 years ago

@andykais Certificates are platform/ OS neutral AFAIK. It is the way we install certificate to the OS certificate store differ between OS.

rubencodes commented 2 years ago

Follow-up question on this - is there any way to detect an expired certificate? So I can create + trust a new one?