SSL certificate issue on WSL2

I have had weird SSL certificate issue couple of times in WSL2 when I try to fetch posts in my Eleventy & WordPress setup. First time I took me 4 hours to figure this out, this time 2 hours. Now it’s time to add a note for future me!

sudo hwclock -s

For some reason WSL2 system time sometimes is incorrect and hwclock sets the system time from the hardware clock.

I guess the WSL2 (Ubuntu) system time gets out of the SSL certificate date for some reason. Anyways, this quick tip solves the issue for me and sets the time correctly.