I send a request to an external resource, which is located in a cloud (I can't put certificates to JVM) from Apache Wink web service and I know that when I try to make a request from the browser, I get a correct answer.
String serviceURL = "https://someurl&ciUser=user&ciPassword=password";
ClientConfig clientConfig = new ClientConfig();
clientConfig.setBypassHostnameVerification(true);
RestClient client = new RestClient(clientConfig);
Resource resource = client.resource(serviceURL);
But I get the following exception:
[err] org.apache.wink.client.ClientRuntimeException: java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
[err] at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java:240)
[err] at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java:189)
[err] at org.apache.wink.client.internal.ResourceImpl.get(ResourceImpl.java:302)
UPDATE
I also try this but get the same errors
String serviceURL = "https://url&ciUser=user&ciPassword=password";
//Perform basic http auth
ClientConfig clientConfig = new ClientConfig();
BasicAuthSecurityHandler basicAuthSecurityHandler = new BasicAuthSecurityHandler("user", "password");
clientConfig.handlers(basicAuthSecurityHandler);
RestClient client = new RestClient(clientConfig);
Is it possible to solve this problem?
Try below steps
run the application with https with jks file i export.
view certificates with browser.
Export it and save into .cer file
import it with java keytool.
this is the command :