Go to All Forums

Behind Proxy Java Code

Hi Team,

As I am behind proxy and I am trying to access REST API through java code.

Can anybody share the java code for setting proxy.

As I have already tried below code

// HTTPS

System.setProperty("https.proxyHost", "https://proxy.abc.com");

System.setProperty("https.proxyPort", "443");

 

But I am getting below error :

 

Exception in thread "main" 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 targetxception in thread "main" 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 at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)

 

Reply 1
Replies (0)