VPN stops connecting, the log mentions a certificate, and the first instinct is to replace the profile. A device clock that is minutes or hours off produces exactly that error, because certificate validity is judged against the local instant. The timezone label on screen is not the problem; the underlying time is. Check the clock before you touch any certificate material.

The error looks like a certificate problem, not a clock problem

A TLS handshake fails when the peer's certificate falls outside its validity window relative to the verifier's clock. That check runs on the client, so a client clock that is wrong rejects a perfectly good certificate. The error text names the certificate, which is why people replace it and see the same failure again. The clock is the cheaper hypothesis and should be tested first.

A clock ahead of real time rejects a current certificate as expired; a clock behind rejects a newer one as not yet valid. Both messages point at dates, and both are produced without any contact with the certificate authority. That is the tell: a genuine expiry affects every client, while a clock problem affects the one machine with the wrong time.

Read the instant, then read the certificate

Print the clock in UTC and the certificate's own dates before changing anything. Comparing two absolute instants removes the timezone question from the investigation entirely. If the certificate window contains the current instant, the certificate is not your failure.

date -u
timedatectl
openssl s_client -connect vpn.example.com:443 -servername vpn.example.com </dev/null 2>/dev/null | openssl x509 -noout -dates

If the local clock is off, check whether it is synchronised and to what. A machine with synchronization disabled, or with a time source it cannot reach, drifts until something fails. The status output names the source and the last successful adjustment, which is more useful than the current offset alone. A large offset with no source configured is a different problem from a small offset against a working source.

timedatectl timesync-status
chronyc tracking

Stop if the certificate is genuinely expired for every client. Then the clock is fine and the certificate needs renewal, not adjustment.

Login codes fail for a related but different reason

Time-based one-time passwords derive their value from the current time step, usually thirty seconds. A device whose clock is off by more than a step or two produces codes the server will not accept, even though the user typed the right digits. The error looks like a wrong password, which sends people into a reset loop that cannot fix a clock.

Work out which component rejected the attempt, because the VPN client, the gateway and the identity provider report different stages. If the code is rejected but the password is accepted, the account is probably fine and the clock is the suspect. If both are rejected, the account may be locked and the clock is a red herring. Follow the provider's recovery guidance rather than approving prompts you did not initiate.

Do not set the clock backwards to make a code work. It hides the cause and breaks the next time-based check.

Fix the source, not the displayed hour

Synchronization is a network service, and the tunnel can change whether the time source is reachable. A corporate source may require the tunnel, while a public source may be blocked by policy. Browsing can work while the time service's own path fails, which is why this dependency is easy to miss. NTP is the protocol behind the adjustment, and it needs its own path like any other service.

sudo systemctl status systemd-timesyncd
sudo chronyc sources -v
ping -c1 203.0.113.20

There is also a bootstrap order problem: a badly wrong clock can prevent an authenticated tunnel, and the only usable time source may sit behind that tunnel. A managed fleet needs a documented procedure for that state, and bypassing certificate verification is not one. On a personal device, use the operating system's own time controls and find out why the clock is lost after shutdown or restore. A machine that drifts every boot has a hardware or configuration problem, not a VPN problem.

After the repair, retry the original connection and read the new error separately. A bad server identity, a certificate that really did expire and a rejected account are three different failures, and mixing them is how a simple clock correction turns into a week of profile swaps.

ບົດຄວາມທີ່ກ່ຽວຂ້ອງ