How to generate a Self-Signed Certificate and use it on PSM HTML5 Gateway?
88
Created On 11/10/26 10:58 AM - Last Modified 11/10/26 15:58 PM
Question
Sometimes it is needed to generate a self-signed certificate and use it for PSM HTML5 Gateway. This article explains how to do it.
Environment
12.0;12.1;12.2;12.6;13.0;13.2;14.0 Privilege Cloud Privileged Session Management (PSM)
Answer
1. Use this script to generate a self-signed certificate if there in’t an internal CA avalilable.
New-SelfSignedCertificate -DnsName "cyberarkpsm.domain.com", "psmserver1.domain.com", "psmserver2.domain.com" -NotAfter (Get-Date).AddYears(3) -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1") -KeyLength 4096 -KeyExportPolicy Exportable -CertStoreLocation "cert:\LocalMachine\My"
** IF IP-address is desired to be added too, you can us this command as example to generate the self-signed certificate.==
New-SelfSignedCertificate -Subject hostname.domain.com -NotAfter (Get-Date).AddYears(3) -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1","2.5.29.17={text}DNS=hostname.domain.com&IPAddress=127.0.0.1") -KeyLength 4096 -KeyExportPolicy Exportable -CertStoreLocation "cert:\LocalMachine\My"
==
2. Change the certificate on the PSM server:
#Copy the thumbprint for the certificate you have the Private Key of (usually the personal certificate of the machine unless the customer followed your instructions to build the CA from scratch)
Get-ChildItem "Cert:\LocalMachine\My"
#Set the path for where the thumbprint will be seen by RDS
$PATH = (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices)
#Execute the change
Set-WmiInstance -Path $PATH -argument @{SSLCertificateSHA1Hash="<INSERT-Thumbprint-HERE>"}