Create client certificates for Snow Inventory Agent and Snow Inventory Server
This article explains how to create and configure client certificates for Snow Inventory Agent and Snow Inventory Server.
The process includes creating a Certificate Authority (CA), creating server and client certificates, importing the server certificate into IIS, configuring the Inventory Server to allow the client certificate, and configuring the Inventory Agent to use the certificate.
Step 1: Create a Certificate Authority
Use PowerShell to create a Certificate Authority (CA):
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature ` -Subject "CN=P2SRootCert" -KeyExportPolicy Exportable ` -HashAlgorithm sha256 -KeyLength 2048 ` -CertStoreLocation "Cert:\LocalMachine\My" -KeyUsageProperty Sign -KeyUsage CertSign
Add this certificate to the trusted root of the Snow Inventory Server.
Step 2: Create the SSL server and client certificates
Use the CA created in the previous step to create the server and client certificates.
If you obtained a CA from another source, load it into the $cert variable using its thumbprint. To list certificates in the certificate store, run:
Get-ChildItem -Path "Cert:\LocalMachine\Root"
Then use the thumbprint of the applicable certificate. For example:
$cert = Get-ChildItem -Path "Cert:\LocalMachine\Root\7FFB11DBD25C428107DB6AA54F6006650B8874BD"
Create the server certificate
Run the following command to create the server certificate:
New-SelfSignedCertificate -Type Custom -DnsName Myserver.demo.local -KeySpec Signature `
-Subject "CN=P2SHostCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "cert:\LocalMachine\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1")
Move the server certificate to the WebHosting section of the certificate store.
Create the client certificate
Run the following command to create the client certificate:
New-SelfSignedCertificate -Type Custom -DnsName Myserver.demo.local -KeySpec Signature `
-Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
Export the client certificate as a .PFX file
- Open
mmc.exe. - Select File > Add/Remove Snap-in.
- Select Certificates.
- Add both the user and computer certificate stores by repeating the previous steps for each store.
- Move the certificates as previously directed if this has not already been done.
- Go to Current User > Personal > Certificates.
- Right-click the client certificate you created.
- Select All Tasks > Export.
- Click Next, select Export private key, and click Next again.
- Click Next, and add a password.
- Select a filename and location, click Next, and then click Finish.
Step 3: Import the SSL server certificate in IIS
If your CA is not already trusted, add the CA to the intermediate certificates.
For additional information, see Microsoft Knowledge Base article KB954755: How to configure intermediate certificates on a computer that is running IIS for server authentication.
- Open the IIS Management Console.
- Select the machine node, and open Server Certificates.
- Click Import in the upper-right corner.
- Browse to the server certificate
.pfxfile. -
Select Allow this certificate to be exported.
IMPORTANT: If this option is not selected, an error may occur when you create HTTPS bindings using the new SSL certificate.
- Click OK.
You can now create an HTTPS binding using the certificate for the DNS name specified as the certificate common name.
NOTE: If the client certificate was not issued by a CA trusted by the server, IIS returns an HTTP 403 error.
Step 4: Configure the Snow Inventory Server
Add the thumbprint of the client certificate created previously to snowserver.config:
<BaseAddress>https://*:8080</BaseAddress> <RequireClientCertificate>true</RequireClientCertificate> <ClientCertificateAllowlist> <Thumbprint>E99A283F113517D9A887823D82E828E837D1FC6A</Thumbprint> </ClientCertificateAllowlist>
Step 5: Configure the Snow Inventory Agent
For Snow Inventory Agent 6, add the certificate under the <ClientCertificate> node as described in the User Configuration Guide.
You must also generate an encrypted version of the password used when creating the .pfx file. Encrypt the password using snowcrypt.exe with the encryptpass2 flag.
Configure the agent using the client certificate:
<Server>
<Endpoint>
<Address>https://Yourserver.demo.local:443/</Address>
<ClientCertificate>
<FileName>certificate.pfx</FileName>
<Password>1495765cad2e8e54c31288e0e326b66e2a0d9516e96f04998265363d3bf81141a</Password>
</ClientCertificate>
</Endpoint>
</Server>