This article describes the steps required to configure the Foglight Management Server (FMS) with a CA‑signed certificate issued by either a public (third‑party) or private (internal/in‑house) Certificate Authority, enabling secure HTTPS connections for users and Foglight Agent Manager (FglAM) clients.
Review the following sections depending on the certificate management process in the environment:
$FMS_HOME is where the FMS is installed.
There are multiple keystores used by Foglight.
$FMS_HOME/config/tomcat.keystore (default password: nitrogen)$FMS_HOME/jre/lib/security/cacerts (default password: changeit)
The following steps need to be completed to generate a new key pair in the Foglight keystore, create a Certificate Signing Request (CSR) for it to be signed by a Certificate Authority (CA) and then import the signed certificate.
$FMS_HOME/config/$FMS_HOME/config/tomcat.keystoretomcat certificate from the tomcat.keystore keystore using the following command:
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -delete -alias tomcat
tomcat alias using the following command:
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -alias tomcat -keyalg RSA -keysize 2048 -genkeypair -validity [number of days] -dname "CN=[your_fmsserver_dns_name],OU=[your_organizational_unit_name],O=[your_organization_name],L=[your_city_name],ST=[your_state_name],C=[your_two-letter_country_code]" -ext SAN=dns:[your_fmsserver_dns_name],ip:[your_fmsserver_ip]
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -alias tomcat -certreq -validity [number of days] -ext SAN=dns:[your_fmsserver_dns_name],ip:[your_fmsserver_ip] -file foglight.csr
tomcat.keystore using the following command (CA certificates may need to be imported first; refer to section Import CA's root and intermediate certificates of this KB article).
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -alias tomcat -validity [number of days] -trustcacerts -import -file [ca signed certificate]
or
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -alias tomcat -validity [number of days] -importcert -file [ca signed certificate chain in p7b format]
Example:
--- Delete key after completing backups
C:/Quest/Foglight/jre/bin/keytool -keystore C:/Quest/Foglight/config/tomcat.keystore -storepass nitrogen -delete -alias tomcat
--- Create new key
C:/Quest/Foglight/jre/bin/keytool -keystore C:/Quest/Foglight/config/tomcat.keystore -storepass nitrogen -alias tomcat -keyalg RSA -keysize 2048 -genkeypair -validity 730 -dname "CN=servername.domain.com,OU=IT,O=Your Company,L=Your City,ST=Your State,C=US" -ext SAN=dns:servername.domain.com,dns:serveralias.domain.com
--- Generate CSR
C:/Quest/Foglight/jre/bin/keytool -keystore C:/Quest/Foglight/config/tomcat.keystore -storepass nitrogen -alias tomcat -certreq -validity 730 -ext SAN=dns:servername.domain.com,dns:serveralias.domain.com -file foglight.csr
--- Import signed certificate
C:/Quest/Foglight/jre/bin/keytool -keystore C:/Quest/Foglight/config/tomcat.keystore -storepass nitrogen -alias tomcat -validity 730 -trustcacerts -import -file foglight.cer
If you have an existing SSL certificate and you want to use this certificate in Tomcat, follow the steps below to import this SSL certificate.
Note: This certificate must be provided in the PKCS #12 (pfx) format. If the certificate and private key are saved in separate files, run the following command to merge them to the PKCS12 format:
openssl pkcs12 -export -in $certfile -inkey $keyfile -out $keystorefile -name tomcat -CAfile $cacertfile -caname root
To import a certificate in Tomcat:
$FMS_HOME/config/tomcat.keystoretomcat certificate from the tomcat.keystore keystore using the following command:
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -alias tomcat -delete
Obtain the certificate's alias name from the certificate PFX file using the following command:
$FMS_HOME/jre/bin/keytool -keystore $your_certificate_pfx_file -storepass $certificate_pfx_password -list -v
The following is an example of command output. The value of Alias name is required in step 4.
Merge the Tomcat keystore and the PKCS12 keystore using the following command:
$FMS_HOME/jre/bin/keytool -importkeystore -destkeystore $FMS_HOME/config/tomcat.keystore -deststorepass nitrogen -destalias tomcat -destkeypass nitrogen -srckeystore [your_certificate_pfx_file] -srcstorepass [certificate_pfx_password] -srcstoretype pkcs12 -srcalias [alias_name_in_step_3]
In environments where an in-house certificate granting authority (CA) is in use, the CA’s certificate may need to be added as trusted certificates to the keystore; otherwise errors such as keytool error: java.lang.Exception: Failed to establish chain from reply will prevent the import of the signed certificate.
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -import -trustcacerts -alias rootca -file [YourRootCA.cer]
$FMS_HOME/jre/bin/keytool -keystore $FMS_HOME/config/tomcat.keystore -storepass nitrogen -import -trustcacerts -alias intermediateca -file [YourIntermediateCA.cer]
Review the following sections to configure the FglAM for HTTPS connections to the FMS from the user interface or by manually editing the configuration file.
$FglAM_HOME is where FglAM is installed.
$FglAM_HOME/bin/fglam --configure8080 to 8443 or specify the port if using a non-default one, such as 443.
$FglAM_HOME\state\default\config\fglam.config.xmlhttp-upstream url entry as follows:
From:
<http-upstream url="http://foglight.yourdomain.com:8080" ssl-allow-self-signed="false" compressed="true"/>
To:
<http-upstream url="https://foglight.yourdomain.com:8443" ssl-allow-self-signed="false" compressed="true"/>
$FglAM_HOME/bin/fglam --add-certificate CertificateAlias=/path/certificate_filename
Note: The name used as CertificateAlias is not important; use something unique to represent the certificate being imported.
Futher helpful links about merging keys and importing certificates:
How to import an existing SSL certificate for use in Tomcat
Import private key and certificate into java keystore