2

I am trying to hit a http (not https) url, and getting error like 'SunCertPathBuilderException: Unable to find valid certificate path to requested target'. I know if it is https communication, I can insert the public cert of the server to java cacerts file, but I am trying to hit an http url.

a. Why am I getting this error for http?

b. How can I resolve this.

Thanks in Advance

  • 1
    Are you sure you aren't getting HTTP->HTTPS redirect or something like that? What HTTP library do you use? Could you enable debug logging for that library? Could you check your program output when running with `-Djavax.net.debug=all`? – Juraj Martinka Aug 08 '19 at 07:46
  • 2
    Hi . Juraj, thanks for the reply. Seems to be the http api is calling other https apis to get some details. I added the certificates of underlying https apis to my trust store and resolved the problem. – chamu majety Aug 09 '19 at 02:15

0 Answers0