How to update/change expired certificates on HTML5 Gateway
103
Created On 11/10/26 10:56 AM - Last Modified 11/10/26 15:54 PM
Objective
How to update/change expired certificates on HTML5 Gateway?
NOTE: these steps are an example for usage with HTML5GW as an RPM Deployment, and not for a DOCKER deployment
Environment
10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;10.9;10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0
Procedure
-- First, we need to remove the old certificates on the server --
*use readlink -f /usr/bin/java | sed "s:bin/java::" to get the [java-installed-location].
*replace passwords of the keystores with the correct ones in environment
*in this example, the alias used is psmgw and psmgw_guacd_cert. it will be different depending on environment/deployment itself.
1. Login to the HTML5 Gateway as root user / user with root privileges
2. Navigate to the location where the keystore is stored into
In this example, the keystore, certs are created and stored in /opt/secrets
3. List Certificates stored in the keystore
command to execute: keytool -list -keystore ./keystore
4. Delete away the Existing Certificate alias psmgw used between client and Tomcat from the Keystore (Default is only 90 days)
command to execute: keytool -delete -alias psmgw -keystore ./keystore
5. Delete away the Existing Certificate alias psmgw_guacd_cert used between tomcat and guacd
command to execute: keytool -delete -alias psmgw_guacd_cert -keystore ./keystore
6. List Certificates stored in the keystore to verify that all certificates are deleted
command to execute: keytool -list -keystore ./keystore
7. Delete away the Existing Certificate alias psmgw_guacd_cert from the Java keystore
command to execute: keytool -delete -alias psmgw_guacd_cert -keystore /usr/lib/jvm/[java-installed-location]/jre/lib/security/cacerts
Key in Password when prompted (default Password is changeit)
8. List Certificates stored in the Java keystore to verify that certificate is deleted
command to execute: keytool -list -keystore /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/jre/lib/security/cacerts | grep psmgw_guacd_cert
If the cert is deleted, there will be no entries being returned.
-- After removing the old certificates, we will create a new one --
1. Go into /opt/secrets directory, then generate new CSR
keytool -genkeypair -alias psmgw -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -validity 3650 -keystore ./keystore -storepass "Cyberark1"
keytool -certreq -keyalg RSA -alias psmgw -file psmgw.csr -keystore ./keystore -ext san=dns:psmgw.cybrlab.local,ip:10.0.85.1 -keypass "Cyberark1" -storepass "Cyberark1"
2. Generate the new certificate with the new CSR, and copy back into the HTML5GW server's directory /opt/secrets
3. Import the new certificate into the keystore:
keytool -import -trustcacerts -alias psmgw -file vhapsmgw.p7b -keystore ./keystore -storepass "Cyberark1"
-- Configure guacd to work with SSL to PSMGW --
1. Generate new keypair and certificate
openssl req -x509 -nodes -days 1095 -newkey rsa:4096 -keyout ./key.pem -out ./guacd.crt
keytool -import -alias psmgw_guacd_cert -keystore ./keystore -trustcacerts -file ./guacd.crt
2. Add the generated certificate to the [java-installed-location]
keytool -import -alias psmgw_guacd_cert -keystore /usr/lib/jvm/[java-installed-location]/jre/lib/security/cacerts -trustcacerts -file ./guacd.crt
3. Edit guacd.conf to update to the new certs and key
Under the SSL section of the conf file:
[ssl]
server_certificate = /opt/secrets/cert.crt
server_key = /opt/secrets/key.pem
*do update to the correct location, depending on individual environment
-- Restart tomcat and guacd service --
1. service tomcat restart
2. service guacd restart
After that test, and verify and confirm that new certificate is being used.