I am trying to connect fetch a file from a secure URL and I am getting the following exception. Can someone please help me to get a solution for this.
The same URL can be opened through IE and the file can be retrieved. I am also getting a Server Response OK when tried to do a Client Hello. I am replacing the URL with xxx as I will not be able to give it out.
We are able to java.io.FileNotFoundException: https://xxx at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V1.2-120198]) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getHeaderField([DashoPro-V1.2-120198]) at com.stc.eways.http.HttpClientAPI.getResult(HttpClientAPI.java:1179) at com.stc.eways.http.HttpClientAPI.doGet(HttpClientAPI.java:1158) at com.stc.eways.http.HttpClientAPI.get(HttpClientAPI.java:771) at com.stc.eways.http.HttpClient.get(HttpClient.java:1447) at crPAYNET_HTTP_to_eGate_INVPDF_001.executeBusinessRules(crPAYNET_HTTP_to_eGate_INVPDF_001.java:195) at com.stc.jcsre.JCollaboration.translate(JCollaboration.java:144) at com.stc.common.collabService.JCCollabControllerImpl.translate(JCCollabControllerImpl.java:518)
The piece of code for fetching the files from the URL is as follows>
I tried opening the same URL through IE and I am able to get the file. The problem arises when I try to get the file. I am facing the same issue when I try to post the file to a different secure site which resides in the same server as the first one.
hi, As i think when u tried to access any data from a secure server u need to be a trusted client for that sever. when u approved as trusted for that secure server then only u can access that server programmeticaly. n about direct access through the browser this condition does not apply.
Joined: Jun 06, 2006
Thank you for your suggestions. I agree with what you are saying. I have the certificates, public key(trust store) and private key(keystore) with which I am trying to access the secure site. When I tried to run a client tester(general java HTTP client tester), I am getting 'OK' as the response from the server. I believe this means i am connected as a trusted client.
Can you kindly let me know if you have any other suggestions also.