Handling “javax.net.ssl.SSLHandshakeException” in Java for AEM inter-server communication. | Community
Skip to main content
Umesh_Thakur
Community Advisor
Community Advisor
January 29, 2021

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

  • January 29, 2021
  • 2 replies
  • 1383 views

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-communication-82f5060b7399

 

Hope this will help.

Thanks

Umesh Thakur

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

kautuk_sahni
Community Manager
Community Manager
February 1, 2021

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

Kautuk Sahni
Level 5
August 21, 2023

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