Highlighted

How to call https rest endpoint URL in AEM

Avatar

Avatar

suswan12345

Avatar

suswan12345

suswan12345

16-05-2018

Hi all,

I need to call the following rest endpoint from one of AEM java model/servlet.

https://localhost:9002/ws410/rest/catalogs/fanengagement/catalogversions/Staged/products/11009

I am getting the following exception.

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

So I installed the .cer file in my local jdk.

Then I was able to call the above rest point from a static java program.

But I am still unable to call this url from my AEM servlet / model.

Can anyone tell me the steps that I need to follow for successful invocation of the rest url

Thanks,

Suswan

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

[Comments is to ask about the operation of the Forum, not a specific program]

[Moved from the Comments forum to the specific Program forum... Mod]

Replies

Highlighted

Avatar

Avatar

Jitendra_S_Toma

Avatar

Jitendra_S_Toma

Jitendra_S_Toma

06-07-2018

Hi,

Are you running your AEM Instance on https and have used the same certificate?

Regards,

Jitendra

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

07-07-2018

What exception do you get from AEM? Are you using the same local JDK for your test program as for AEM?

Jörg

Highlighted

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K
kautuk_sahni
Community Manager

10-07-2018

Check:

If there was a missing certificate in my truststore that wasn't allowing full certificate chain validation. Root CAs are in JVM, so if author is configured with CA signed certificates you should not see handshake exceptions. If this is same instance, try to make links relative instead of absolute.

Highlighted

Avatar

Avatar

Kunwar

Employee

Avatar

Kunwar

Employee

Kunwar
Employee

10-07-2018

Can you add '-Djavax.net.debug=all' to your startup arguments, restart the system and retest the scenario ? Once replicated, share the stdout.log for review

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

10-07-2018

Please let us know if you have tried the suggestions posted in this thread.