How to Change Access Point TLS Certificate (version 2.2.0 and later)?
This article applies to new installs of Harmony Access point v2.2.0 and later versions.
For older versions (including upgrades from older versions), see How to Change Access Point TLS Certificate?
By default, the Access Point has a self-signed TLS certificate that's automatically generated during the Access Point installation process. Changing the certificate and/or recreating the private key is not possible through the Access Point UI. Instead, both operations require shell access to the Access Point.
Note about Using Harmony Access Point Container Version
Harmony Access Point configuration is located at /var/opt/harmony-ap/etc instead of /etc/harmony-ap (for convenience, /etc/harmony-ap is a symbolic link to that directory).
Commands can be run inside the container with docker exec (using "sudo" in the container is unnecessary):docker exec -it <container name> openssl req -x509 -newkey rsa:3072 -keyout harmony-ap-new.key -out harmony-ap-new.crt -days 365 -nodes
Files can be copied to/from a container using docker cp.
Step-by-step guide
The Access Point TLS certificate can be changed by following the steps described below. Instead of OpenSSL, one can also use Java keytool for manipulating the keystore.
First, take backup copy of the TLS keystore file:
cp -a /etc/harmony-ap/tls-keystore.p12 /etc/harmony-ap/tls-keystore.p12.bakGenerate a new private key and certificate signing request (CSR) by running the command:
openssl req -x509 -newkey rsa:3072 -keyout harmony-ap-new.key -out harmony-ap-new.crt -days 365 -nodes
If you don't have OpenSSL installed, you can generate the certificate on the Harmony Access Point host.
Enter your CSR details.
Obtain a TLS certificate from a trusted Certificate Authority (CA) using the CSR file.
Once the CA has issued the certificate, rename the certificate file to
harmony-ap-new.crt, and copy it to the Access Point.Check the password of the TLS keystore file from the
/etc/harmony-ap/tomcat-conf/server.xmlconfiguration file. The password is located in the "Connector" element's "keystorePass" property.Take a note of the password (
tls_keystore_password).
Create a PKCS#12 container that includes the new key and certificate, and the certificate chain. Use the
tls_keystore_passwordas the export password. Replace the<cert_alias>placeholder with your preferred alias.openssl pkcs12 -export -in harmony-ap-new.crt -inkey harmony-ap-new.key -out tls-keystore.p12 -name <cert_alias> -CAfile ca_bundle.crt -caname cacertReplace the file
/etc/harmony-ap/tls-keystore.p12with the new keystore and update the file permissions.cp tls-keystore.p12 /etc/harmony-ap/tls-keystore.p12 chown harmony-ap:harmony-ap /etc/harmony-ap/tls-keystore.p12 chmod 0640 /etc/harmony-ap/tls-keystore.p12Restart the
harmony-apservice.Ubuntu
systemctl restart harmony-apDocker
docker restart <harmony-ap-container>Check that the log file (
/var/log/harmony-ap/catalina.out) doesn't contain any TLS related errors.In case something goes wrong, restore the original files, and restart the
harmony-apservice.