May 29, 2024
As a GlobalSign customer, sometimes, you will encounter issues with Certificate deployment and installation through the Certificate Automation Manager. One that is recurrent is when a Certificate cannot be installed because a computer receives it outside the Certificate validity period. This happens because the start validity date is in the future compared to the time the computer reads from its local source or its NTP source. As a result, the computer does not validate the Certificate correctly and denies its installation.
Having an accurate time source in a Windows environment is important for several reasons, including:
In this article, we will discuss the main reasons around clock/time skew issues when you are making use of our Certificate Automation Manager solution. The reasons are:
A simple way to test if a client is receiving accurate time information from the time source in your domain is to browse to a public website that hosts a time service, such as a World Time Server. Then, you can compare the time shown on the website against the time show on your computer. If the time on the local computer is nearly the same as the time on the website, you can assume that your time source is accurately delivering information to your device(s). Now you need to dive deep to determine if this time source is NTP-based or not.
This will allow you to know if you the time service is running on your machine. You need to go to click Start Menu, type Services, click Services. This will open the Services window, then you will need to scroll down until you find the Windows Time service. Make sure that the startup type is set to Automatic, and the service status is Running, as shown in the following figure:
The NTP service and settings are determined by the Windows Time Service, also known was W32Time Service. There are some useful commands that you can use to determine whether your computer is correctly configured to receive time information via NTP or not. Here we offer one example, open a command prompt as administrator and run the command:
w32tm /query /status
In the previous example, we can observe at least 4 parameters of interest:
You can see how the computer is using the local CMOS clock. The problem with this time source is that it is linked to an internal clock that depends on the CMOS battery. If this battery loses its power, which will happen eventually, the time will not be provided accurately.
Another good source of information that you can use to understand your current time service settings is the following command:
w32tm /query /configuration
The command outputs are extensive, but the section about time providers can help you understand which time sources are configured in your device. In the previous example:
In the previous example, it was clear that the client machine was configured as NTP client and the rest of parameters looked almost correct. However, the problem with that example is the NTP server. We configured "europe.pool.ntp.local" as the NTP server for the purposes of this article, but in reality the correct domain is "europe.pool.ntp.org".
Also, best practices will tell you that you should configure NTP clients to contact the best time provider for your domain instead of using a publicly accessible NTP server. In this sense, your domain NTP server would be a domain controller that has been selected for the role of the NTP server. Furthermore, depending on the hierarchy, you could have several NTP servers in your domain, these NTP servers would obtain the time information from your Primary Domain Controller (PDC). Finally, the PDC would connect to the publicly accessible time source for accurate time updates. In an Active Directory environment, the hierarchy would look like the one shown in the following figure:
For this, you need to run a few commands on the NTP client machine or server, and it will automatically synchronize its time information to the most reliable source in your domain:
After running these commands, you will get the following output:
Now, you can see that Stratum has changed to 4. This means there are 3 other time sources above this client machine, which makes sense because one of them is the domain controller, PS2-2019-DC. The time source has changed from "Local CMOS Clock" to "PS2-2019-DC". For security reasons, we do not show the FQDN.
If your environment allows for it, you can disable the Hyper-V Time Sync Service from providing samples to the W32TM service. If you do so, W32TM will get updates only from its domain time source as configured above. To disable the Hyper-V Time Sync Service, run the following command from an elevated command prompt:
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider /v Enabled /t reg_dword /d 0
The following tests from the section Identifying Issues in NTP Clients can be performed in your NTP servers too:
Possible outcomes for the previous tests:
Test |
Correct |
Incorrect |
---|---|---|
Simple Test |
The NTP server's local time should be very close to the time shown on the website, most likely less than one second behind or ahead. |
The NTP server's local time is way behind or way ahead compared to the time shown on the website, most likely by several seconds or minutes. |
Windows Time Service |
The NTP server's time service is up and running, and its startup type is configured as automatic. |
The NTP server's time is disabled or malfunctioning, or its startup is configured as manual. |
Windows Time Service Status |
The stratum is between 1 and 4 (healthy), the source is your PDC (if you have more than one NTP server) or a public, reliable NTP server (if your PDC is the only NTP server in your network). The poll interval is approximately 1024 seconds. |
The stratum is above 4 (unhealthy), the source is not your PDC (if you have more than one NTP server) or a public, reliable NTP server (if your PDC is the only NTP server in your network). The poll interval is very high, sometimes 32768 seconds. |
There are several places where you can find the NTP settings on your server. We will cover some of the most important for you to verify on your environment.
W32Time parameters are stored in the registry location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
Two parameters that you should double check are NtpServer and Type:
W32Time time providers are stored in the registry location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders
There are three sub-folders, and these contain individual information on each of time providers:
If your environment allows for it, you can disable the Hyper-V Time Sync Service from providing samples to the W32TM service. If you do so, W32TM will get updates only from its domain time source as configured above. To disable the Hyper-V Time Sync Service, run the following command from an elevated command prompt:
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider /v Enabled /t reg_dword /d 0
For this, first you need to find a public NTP server that is close to you. You can check the following URL to find it:
http://support.ntp.org/bin/view/Servers/WebHome
NOTE: There are several other publicly available sources, so make sure you choose the one that is more convenient to you.
When you choose the public NTP time reference, run the following commands on the PDC:
You can then run the following two commands to verify the changes were applied correctly:
To configure additional DCs to sync with the PDC to obtain NTP information, you need to execute the following commands:
Check your certificate installation for SSL issues and vulnerabilities.