mkcert icon indicating copy to clipboard operation
mkcert copied to clipboard

Certificate is generated with a wrong DateTime

Open Antonytm opened this issue 2 years ago • 1 comments

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

  1. .\mkcert.exe -install
  2. .\mkcert.exe "*.headless.localhost"
  3. .\mkcert.exe -install
  4. Open browser, try to open cm.headless.localhost image
  5. Open certmgr.msc image image image
  6. 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)

Antonytm avatar May 11 '23 22:05 Antonytm

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?

Antonytm avatar May 12 '23 17:05 Antonytm