mkcert
mkcert copied to clipboard
Certificate is generated with a wrong DateTime
Environment
- Operating system (including version): Windows 11 Pro 22H2
- mkcert version (from
mkcert -version): 1.4.1 - Server (where the certificate is loaded): local
- Client (e.g. browser, CLI tool, or script): browser/cli
- Date, time and timezone are configured to set automatically
What you did
.\mkcert.exe -install.\mkcert.exe "*.headless.localhost".\mkcert.exe -install- Open browser, try to open cm.headless.localhost
- Open
certmgr.msc - Check current time: 12 of May 2023, 1:26 AM GMT+2
What went wrong
For some reason, the certificate generates for future + 8 hours. And it is a reason, why it is invalid for browser or CLI calls. (Or there is some other reason, I will confirm Date/time hypothesis after 10 hours)
I can confirm that error was related to the timezone. It started to work in the morning after 8+ hours.
The issue was not reproducible on another machine. So, I don't know what exactly specific is about that machine.
Why don't generate certificates valid from -1 day to avoid this kind of issue?