Sending emails over HTTPS fails with the following error in the webapp pod log:
jakarta.mail.MessagingException: Could not convert socket to TLS;...javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This is because the certificate being presented by the SMTP server is not trusted by the webapp pod for one of the following reasons:
The external certificate needs to be added to the default Java trust store. This can be done by following the instructions below:
kubectl -n *namespace* cp <APPIAN_SITE_NAME>-webapp-0:/usr/local/appian/ae/java/jre/lib/security/cacerts ./cacerts
keytool -import -alias targetServerCert -file ./<TARGET_SERVER_CERT>.PEM -keystore ./cacerts -storepass changeit
keytool -import -alias myRootCA -file ./<ROOT_CA>.pem -keystore ./cacerts -storepass changeit
keytool -list -keystore ./cacerts -storepass changeit
base64 -w0 ./cacerts > cacerts_base64
kubectl create secret generic cacerts-secret --from-file=keystore.jks=./cacerts_base64 -n <APPIAN_SITE_NAMESPACE>
.spec.webapp
additionalVolumes: - name: keystore-secret secret: secretName: "cacerts-secret" items: - key: keystore.jks path: cacerts additionalVolumeMounts: - name: keystore-secret mountPath: /usr/local/appian/ae/java/jre/lib/security/cacerts subPath: cacerts readOnly: true
/usr/local/appian/ae/java/jre/lib/security/cacerts
~/security
This article applies to all versions of self-managed Appian on Kubernetes.
Last Reviewed: March 2023