Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Handling “javax.net.ssl.SSLHandshakeException” in Java for AEM inter-server communication.


Community Advisor

I was setting up one dispatcher flush agent in one of my publisher server to implement a real scenario. After entering values in all the required fields, when I click on the Test Connection on the result page it says “Replication test failed“


After looking into the stack trace I was surprised and clueless as the required certificate was present and active on my dispatcher server.

Article can be found here.



Hope this will help.


Umesh Thakur

2 Replies



Thank you for writing this article and sharing this with the AEM Community. 

Kautuk Sahni


Level 5

Hi @Umesh_Thakur,

We are facing same exception while connecting to Service Layer APIs with domain for example services.companyname.com from AEM instance.

Do we need to add the certificate in AEM Global Trust Store?

Adding certificate to AEM Global Trust Store and adding on the server, on which AEM and Java are installed, how are these both different?

Below is the exception stack trace

javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:642)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:461)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:361)
	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392