Expand my Community achievements bar.

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

Avatar

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.

https://tumesh65.medium.com/handling-javax-net-ssl-sslhandshakeexception-in-aem-in-interserver-commu...

 

Hope this will help.

Thanks

Umesh Thakur

2 Replies

Avatar

Administrator

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



Kautuk Sahni

Avatar

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