Skip to content
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

Expiration #343

Open
lollita opened this issue Feb 21, 2021 · 5 comments
Open

Expiration #343

lollita opened this issue Feb 21, 2021 · 5 comments

Comments

@lollita
Copy link

lollita commented Feb 21, 2021

Do it is possible to set custom expiration date?

@ikeyan
Copy link

ikeyan commented Feb 26, 2021

mkcert/cert.go

Lines 59 to 62 in 0a3190b

// Certificates last for 2 years and 3 months, which is always less than
// 825 days, the limit that macOS/iOS apply to all certificates,
// including custom roots. See https://support.apple.com/en-us/HT210176.
expiration := time.Now().AddDate(2, 3, 0)

expiration period is hardcoded here, and the comment tells the reason of the value.

@ikeyan
Copy link

ikeyan commented Feb 26, 2021

if this is a feature request, maybe duplicate of #339.

@andykais
Copy link

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
Copy link

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

@rubencodes
Copy link

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

kixelated added a commit to kixelated/mkcert that referenced this issue Mar 25, 2023
The hard-coded default of 2 years, 3 months works for most applications.
However, some applications enforce that the certificate is only valid
for a short period and this default is too long.

For example, WebRTC fingerprinting enforces a max duration of 30 days.
WebTransport is even more extreme and requests certs valid for more than
14 days. These certificates are meant to be ephemeral.

Fixes FiloSottile#339 FiloSottile#343
kixelated added a commit to kixelated/mkcert that referenced this issue Mar 25, 2023
The hard-coded default of 2 years, 3 months works for most applications.
However, some applications enforce that the certificate is only valid
for a short period and this default is too long.

For example, WebRTC fingerprinting enforces a max duration of 30 days.
WebTransport is even more extreme and requests certs valid for more than
14 days. These certificates are meant to be ephemeral.

Fixes FiloSottile#339 FiloSottile#343
kixelated added a commit to kixelated/mkcert that referenced this issue Mar 25, 2023
The hard-coded default of 2 years, 3 months works for most applications.
However, some applications enforce that the certificate is only valid
for a short period and this default is too long.

For example, WebRTC fingerprinting enforces a max duration of 30 days.
WebTransport is even more extreme and rejects certs valid for more than
14 days. These certificates are meant to be ephemeral.

Fixes FiloSottile#339 FiloSottile#343
dancewhale pushed a commit to dancewhale/mkcert that referenced this issue Jul 10, 2023
The hard-coded default of 2 years, 3 months works for most applications.
However, some applications enforce that the certificate is only valid
for a short period and this default is too long.

For example, WebRTC fingerprinting enforces a max duration of 30 days.
WebTransport is even more extreme and rejects certs valid for more than
14 days. These certificates are meant to be ephemeral.

Fixes FiloSottile#339 FiloSottile#343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants