How to change certificate used by Cayosoft Guardian
Cayosoft Guardian creates its own self-signed certificate during installation. This article describes how to change this default certificate to a custom one using netsh commands for HTTP.
How to change the certificate in Cayosoft Guardian web portal
Open the Cayosoft Guardian web portal.
Expand Settings node.
Click the Service Settings.
Select Network Settings.
Click Properties.
On the General tab, click the edit icon next to the SSL certificate label.
Select a certificate and click Select.
Go back to Service Settings and press Restart service.
How to change the certificate with PowerShell
Run an elevated PowerShell ISE or PowerShell command prompt.
-
Run the following command to check if the port 443 already has a bound certificate:
Copynetsh http show sslcertIf the command above returned a record with
IP:port = 0.0.0.0:443, you need to delete the old certificate:Copynetsh http delete sslcert ipport=0.0.0.0:443 -
Bind the new certificate to 443 port:
Copynetsh http add sslcert ipport=0.0.0.0:443 certhash="<certificate thumbprint>" appid="{<application guid>}" -
Replace
<certificate thumbprint>with your custom certificate thumbprint found in the properties of the certificate. Replace<application guid>with the GUID of the bound application. You can use the same GUID that was returned by thenetsh http show sslcertcommand. Refer to the following example:Copynetsh http add sslcert ipport=0.0.0.0:443 certhash="831C11EF1D8886A0B3D0A598
Troubleshooting "A specified logon session does not exist. It may already have been terminated" issue
When changing the SSL certificate used by the Cayosoft Guardian, you may find that a certificate you uploaded appears in the Select SSL Certificates list, but selecting it returns the following error:
A specified logon session does not exist. It may already have been terminated.
Cause
This error indicates that the selected certificate does not have a usable private key on the Cayosoft Guardian server. When you select a certificate, Cayosoft Guardian binds it to the HTTPS endpoint, and that binding operation requires access to the certificate's private key.
The most common causes are:
- The certificate was exported or provided without its private key (for example, in .cer format instead of .pfx (PKCS#12)).
- The certificate was imported so that the private key is not accessible to the Local Machine account (for example, it was imported into the Current User store instead of Local Machine, or the private key permissions do not allow the Cayosoft Guardian service account to access it).
Solution
- Re-export the certificate from your Certificate Authority, making sure to select Yes, export the private key, and save it in .pfx (PKCS#12) format.
- Import the .pfx file into the Local Machine > Personal certificate store on the Guardian server (run certlm.msc).
- In Cayoosft Guardian, navigate to Settings > Service Settings > Network Settings, and then select the certificate again.
- Restart the Cayosoft Guardian service.
After the service restarts, the certificate binds successfully and the error no longer appears.
Comments
0 comments
Please sign in to leave a comment.