Gluu Server CE Cert import
π― Purpose
This guide explainsoutlines howthe process to securely fetchlog ainto self-signedthe orGluu internalServer virtual machine (VM), retrieve the Gluu server's TLS certificate from your Gluu server (gluu.mslspartners.com),certificate, import it into the Java truststore, and restart Gluu services to establishenable trusted internal HTTPS communicationcommunication.
π Logging into the Gluu VM
ssh root@your-gluu-server-ip
π‘ If Gluu is running locally (e.g., in Proxmox/XCP-ng), log in via the hypervisor console directly as root.
π§° Prerequisites
π§βπ»Root or sudo access to the GluuserverVMπDomain name ofyour Gluu server:Gluu:gluu.mslspartners.comπJava truststore password (default:changeitor custom)π¦ Installed tools:Tools:openssl,keytool,awk
π Step-by-Step Instructions
1οΈβ£ Create athe ScriptΒ File
nano /root/import-gluu-cert.sh
2οΈβ£ Paste the Script Below
#!/bin/bash
DOMAIN="gluu.mslspartners.com"
CERT_PATH="/etc/certs/gluu-full-chain.crt"
KEYSTORE_PATH="/opt/jre/lib/security/cacerts"
KEYSTORE_PASS="changeit"
ALIAS="gluu-remote"
echo "π Fetching certificate from $DOMAIN..."
openssl s_client -showcerts -connect ${DOMAIN}:443 </dev/null \
| awk '/BEGIN CERT/,/END CERT/ { print }' > "$CERT_PATH"
if [[ $? -ne 0 ]]; then
echo "β Failed to retrieve certificate."
exit 1
fi
echo "ποΈ Removing old certificate (if it exists)any)..."
keytool -delete -alias "$ALIAS" -keystore "$KEYSTORE_PATH" -storepass "$KEYSTORE_PASS" 2>/dev/null
echo "β Importing new certificate..."
keytool -import -alias "$ALIAS" \
-keystore "$KEYSTORE_PATH" \
-trustcacerts -file "$CERT_PATH" \
-storepass "$KEYSTORE_PASS" -noprompt
echo "π Restarting Gluu services..."
/root/restart-gluu.sh
echo "β
Import and restart complete!"
3οΈβ£ Make the Script Executable
chmod +x /root/import-gluu-cert.sh
4οΈβ£ Run the Script
/root/import-gluu-cert.sh
π Verifying Certificate Import
ππ§Ύ Check CertificateTruststore in Truststore:Entry:
keytool -list -keystore /opt/jre/lib/security/cacerts -storepass changeit | grep gluu-remote
ππ ConfirmCheck Active Truststore:Truststore in Java:
/opt/jre/bin/java -XshowSettings:properties -version 2>&1 | grep trustStore
ππ CheckConfirm Issuer and Issuer/Subject:
openssl x509 -in /etc/certs/gluu-full-chain.crt -noout -issuer -subject
π Troubleshooting
- β
TrustSSLpath errors:Errors:EnsureUsually mean thefullcertcertificateisn'tchain is present ingluu-full-chain.crt.
/etc/certs/import root.
/opt/gluu/jetty/<componentapp>/logs/.
ππ Notes
- This
methodguide istailoredfor internal/self-signed Gluucertificates.certificates. For publicPublic CAcertificates,certsensureusuallythedonβtfullrequirechainthisisstepvalidunlessandusingtrustedabynon-standardyour system.CA.- The script assumes a restart script exists at
/root/restart-gluu.sh.