When software is downloaded, the operating system checks for the digital certificate created through code signing to assure the safety of the software attempting to be downloaded. Code signing provides proof that software came from a trusted source and hasn’t been tampered with since its release by applying digital signing to the software package.
All patches delivered to your Software Vulnerability Manager console are delivered as SPS packages ready to be created into an install package for deployment. During the creation of an installation package, the WSUS (Windows Server Update Services) server digitally signs the packages before publishing them to your WSUS server using either WSUS or SCCM. When an update or a patch is installed, the client machine verifies that the software has come from a trusted source by checking its digital signature. If it isn’t digitally signed or if the certificate has expired, the software will fail to install.
It’s critical for the functionality of Software Vulnerability Manager that certificates are created and applied to WSUS correctly to prevent publishing issues. There are three ways of doing this:
- Use a WSUS self-signed certificate generated by the WSUS server using the Software Vulnerability Manager connection tool contained in the console plugin.
- On Windows enterprise networks that run a root Certification Authority you can request a code signing certificate from the Root CA.
- Obtain a code signing certificate from an external Trusted Certificate issuer. This can be expensive and is only required if you want to make your WSUS server public on the internet. This will not be covered in this article, as it’s an unlikely scenario.
Generate a Windows CA code signing certificate for WSUS
The process of creating a code signing certificate requires two parts. The first is the configuration that’s done on the Windows RootCA Server, and the second is requesting the certificate from the RootCA on the WSUS Server. Ensure you have administrative access to both servers before continuing.
Configuration in Windows RootCA server
- Connect to your Windows RootCA server and navigate to the Certificate Authority Console.
![ca.jpg ca.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14813i00E7BC78AE5F7169/image-size/large?v=v2&px=999)
- Create a code signing certificate template by selecting Certificate Templates in the left pane.
![cert templates.jpg cert templates.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14814iFC0E7384E3F5BC6C/image-size/large?v=v2&px=999)
- Right-click Certificate Templates and select Manage. This will open the Certificate Templates Console.
- In the Certificate Templates Console find the Code Signing template in the templates list.
![code signing.jpg code signing.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14816iC0C8D36E827B9D79/image-size/large?v=v2&px=999)
- Right-click on Code Signing Template and select Duplicate Template. The template configuration will display.
![duplicate template.jpg duplicate template.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14817iD8639A87B7C6C188/image-size/large?v=v2&px=999)
- There are several tabs you’ll update within the template configuration.
- First, select the General tab. Give the certificate template a name. In this example, it’s “WSUSCert.”
- Set the validity period to a period of your choice. It may be best to use a long validity time, as this ensures all your published patches will continue to work for a long period.
- Select Apply.
- Select Request Handling.
- Check Allow Private Key to be exported.
- Select Prompt the user during enrollment.
- Select Apply.
![image (8).png image (8).png](https://community.flexera.com/t5/image/serverpage/image-id/15195i0E8DE24EA463C50E/image-size/large?v=v2&px=999)
- Select Subject Name.
- In the Subject name format drop-down, select Common Name.
- Select only the User principal name (UPN) checkbox.
- Select Apply.
- Select Security.
- Provide Read and Enroll permissions for a user or user group.
- Select Apply.
- Select the Extensions tab.
- Select the Key Usage extension, then select the Edit button.
- In the Edit Key Usage Extension tab:
- Ensure that Digital Signature and Make this Extension Critical are both checked.
- Select Apply and OK if any changes were made or Cancel if no changes need to be made.
![edit key usage.jpg edit key usage.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14946i618473DC02CD8DD5/image-size/medium?v=v2&px=400)
- Close the Certificate Templates console and return to the CA Console. Next, you’ll issue the template so that it becomes available for uses to request a certificate.
- Right-click on the Certificate Templates and select New > Certificate Template to Issue.
![cert template to issue.jpg cert template to issue.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14833iE89DBD429DED9210/image-size/medium?v=v2&px=400)
- A list of available templates will be displayed. In the list, select the name of the template you just created and click OK.
![enable cert templates.jpg enable cert templates.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14834i8B3E5BB4AE308287/image-size/medium?v=v2&px=400)
Your new template will now appear in the Certificate Templates container in the main Certification Authority Console.
This completes the process on the Certificate Authority. You can now log off your CA server. You shouldn’t need to connect to it again during this process unless you have a domain certificate policy that requires Certificates to be approved on the CA.
Request a WSUS code signing certificate
Next, you’ll log on to your WSUS Server.
- Open an MMC Console by right-clicking on the Start menu and selecting Run.
![mmc.jpg mmc.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14839i1F41982A9D062556/image-size/medium?v=v2&px=400)
- In MMC Console, select File > Add/Remove Snap-in…
![add remove snap in.jpg add remove snap in.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14840i860F06353E09D5BC/image-size/medium?v=v2&px=400)
- Select Certificates, then select Add.
![add certificate.jpg add certificate.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14842i3BD857DF3F39A0B7/image-size/medium?v=v2&px=400)
- Select My User Account, then select Finish.
![my user account.jpg my user account.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14843i7821871C0B9AA9D5/image-size/medium?v=v2&px=400)
- To request the certificate, right-click the Personal folder in the left pane of the Certificates console. Then select All Tasks > Request New Certificate.
![request new cert.jpg request new cert.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14844i3BE673ED6833458D/image-size/medium?v=v2&px=400)
- The Certificate Enrollment wizard will now start. Select Next.
![cert enrollment wizard.jpg cert enrollment wizard.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14845iA823B049013626DA/image-size/medium?v=v2&px=400)
- By default, the Active Directory Enrollment Policy is selected. You should not need to make any changes to this section. Select Next.
![before you begin.jpg before you begin.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14846i8A1CEF24FBE1FE52/image-size/medium?v=v2&px=400)
- In the Request Certificates menu, select the checkbox next to the certificate template you created earlier on the CA, then select Enroll.
![Request Certificates.jpg Request Certificates.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14847iA2CF6DC942C91416/image-size/medium?v=v2&px=400)
- You will then be shown the results of your request. It should show Status: Succeeded.
![installation results.jpg installation results.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14848i8F59626566B248DB/image-size/medium?v=v2&px=400)
Your new Code Signing Certificate will now appear in the Personal\Certificates folder.
![new code signing cert.jpg new code signing cert.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14849i0F26DDB45A338832/image-size/medium?v=v2&px=400)
Export the certificate
- Next, you’ll export the certificate and its private key. Right-click on the certificate and select All Tasks > Export.
![export cert.jpg export cert.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14850i42BD63A2D2B59BD5/image-size/medium?v=v2&px=400)
- This will open the Certificate Export Wizard. Select Next.
![next.jpg next.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14857i3B5044D8777546A7/image-size/medium?v=v2&px=400)
- Select Yes, export the Private Key then select Next.
![yes, export private key.jpg yes, export private key.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14852i5AF309CEC779C04E/image-size/medium?v=v2&px=400)
- Ensure Include all certificates in the certification path and Export all Extended Properties are selected. Then click Next.
![Include all certificates.jpg Include all certificates.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14853iBF1A3A60A9D68CE0/image-size/medium?v=v2&px=400)
- Enter a password, then select Next.
![enter password.jpg enter password.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14854i6B29E46F0E4FB959/image-size/medium?v=v2&px=400)
- Select Browse to select a location to save the certificate. Once the filename and file path are entered, click Next.
![save cert.jpg save cert.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14855iD3DB58A49C07CC6D/image-size/medium?v=v2&px=400)
- Verify the information you’ve entered is correct, then select Finish.
![Finish wizard.jpg Finish wizard.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14856i8D2F857FF9C880A2/image-size/medium?v=v2&px=400)
Import the certificate into WSUS/SCUP
PKI-generated certificates can only be imported into WSUS using a PowerShell Script. Follow the steps below to import the certificate.
- Open PowerShell as Administrator on your upstream (primary) WSUS server or Software Update Point of SCCM.
- Run the following script to set the WSUS server and its configuration to an object.
[Reflection.Assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$updateServer = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$config = $updateServer.GetConfiguration()
- Next, run the snippet below to set the new code signing certificate.
$config.SetSigningCertificate("<Path to pfxFile>", "<PFX file password>")
This will be a file with both the public and private keys (often a PFX file). You'll need to replace the path and private key password within the placeholder values in quotes.
- Save the changes.
$config.Save()
Resync your Software Update Point to make the certificate display in the Software Update Point Configuration.
Troubleshooting
If you’re having difficulties after following this process, check the items mentioned below.
Check the WSUS certificate stores (WSUS Server)
If you’ve been using a WSUS self-signed certificate and are moving to a PKI certificate generated from your Enterprise Windows CA, once you have installed the certificate, check the WSUS Certificate Store for the Local Computer Account to ensure you’re only showing the one certificate in the WSUS Certificate in this store. This should be the certificate you generated from your CA and should show that you have the private key that corresponds to the certificate. There should be no other certificates in this store.
Also, verify that the certificate is appearing in the Trusted Publishers folder without the private key.
![no private key.jpg no private key.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14944i5653598891D875B9/image-size/medium?v=v2&px=400)
Software Update Point not importing certificate
If you are having difficulties with synchronization, sometimes this can be caused by the Software Update Point (SUP) not importing the certificate into the SCUP during synchronization.
To resolve this:
- Open the SUP and remove all the classifications, then resync the SUP. This will start a sync to import the certificate as there are no classifications to sync.
- Check that the correct certificate is in use by reviewing the Third-Party Updates tab in the SCUP configuration (Software Update Point Component Properties > Third Party Updates).
- Once the certificate appears, re-enable your classification, and resync the SCUP.
![sup component properties.jpg sup component properties.jpg](https://community.flexera.com/t5/image/serverpage/image-id/14945i972812F34DC35F65/image-size/medium?v=v2&px=400)
If you are having issues importing the certificate check wsyncmgr.log and wcm.log for errors regarding the import.