commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manikanda...@polaris.co.in
Subject Error connecting to HTTPS
Date Thu, 26 May 2005 19:10:56 GMT

Hi,

   Am getting an error, when I tried connecting the https server with the
below code. I am not using any certificate to contact the server. Am I
really need a certificate to connect to the server. Because, I have been
told, that I can communicate to this particular server without certificate.

try {

     URI uri = new URI("https://abc.bcd.net",true);
     MySSLSocketFactory sslSocketFactory = new MySSLSocketFactory();

     Protocol myhttps = new Protocol("https", sslSocketFactory, 443);

     HttpClient httpclient = new HttpClient();

     httpclient.getHostConfiguration().setHost("abc.bcd.net", 443,
myhttps);
     httpclient.getHostConfiguration().setProxy("proxyhost",8080);


     String host = uri.getHost();
     int port = uri.getPort();

     AuthScope authScope = new AuthScope(host, port);

     Credentials credential = new UsernamePasswordCredentials
("citimortgage","citimortgage");
     httpclient.getState().setProxyCredentials(authScope,credential);

     GetMethod httpget = new GetMethod("/");
     httpclient.executeMethod(httpget);

}catch(SSLException sslEX) {
     System.out.println("SSLException occured " + sslEX.getMessage());
     sslEX.printStackTrace();
}catch(HttpException ex) {
     System.out.println("HttpException occured " + ex.getMessage());
     ex.printStackTrace();
}catch (IOException ex) {
     System.out.println("IOException occured " + ex.getMessage());
     ex.printStackTrace();
}


Error
-----
org.apache.commons.httpclient.NoHttpResponseException: The server
abc.bcd.net failed to respond

Thanks in Advance,
Mani



This e-Mail may contain proprietary and confidential information and is sent for the intended
recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested
to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying,
disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than
by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message