How to set SOCKS(v4) proxy in tRestClient

Five Stars

How to set SOCKS(v4) proxy in tRestClient

 Hi,

I'm trying to access a Rest-Webservice from Talend,  I used tRestClient but to access the WebService i need to configure SOCKS(v4) proxy, 

So i used tSetProxy---------Component OK ------------>tRestClient-----------(response)---------->tLogRow.

but it throws an exception (attached the log file logs.txt).

1.  tSetProxy (Basic Setting: Proxy type: Socks proxy || host: 127.0.0.1  || port: 1111 
2. tRestClient(Basic Setting: Url: https://***.slnec2.lab.443/**, Relative Pathe: "88-100")

If I provide the same proxy in Firefox then I get the response easily from MozilaRestClient.

 

Please help

Moderator

Re: How to set SOCKS(v4) proxy in tRestClient

Exception in component tRESTClient_1 (Demo1)
javax.ws.rs.ProcessingException: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking https://ph2ecmha.slnec2.lab.vzwnfv.com:443/ecm_service/vapps/VAPP-12909: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:601)
	at org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:578)
	at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1098)
	at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1035)
	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:892)
	at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:863)
	at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:426)
	at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:609)
	at testfile.demo1_0_1.Demo1.tRESTClient_1Process(Demo1.java:940)
	at testfile.demo1_0_1.Demo1.tSetProxy_1Process(Demo1.java:399)
	at testfile.demo1_0_1.Demo1.runJobInTOS(Demo1.java:1341)
	at testfile.demo1_0_1.Demo1.main(Demo1.java:1190)

 


Does the SSLHandshakeException only happen when POST? or happon for any GET/PUT/POST?

Have you tried to use tSetKeystore to load the certification before you connect to REST using tRESTClient for https end point?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How to set SOCKS(v4) proxy in tRestClient

sorry for replying late

Yes  SSLHandshakeException happens for every operation. 1st i have download the certificate(.crt file) then convert it into .jks file using keytool. and use the same in tSetKeyStore, and I have used tSetProxy for SockProxy then tRestClient is use to call the rest client.

tSetKeyStore--------------OncomponentOK----------->tSetProxy-----------------OnSubject OK---------->tRestCleint---------tLog

And now it throws an exception (please find the attached log file).

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog