dcsimg
Regarding the HTTPS
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, September 28, 2007 07:08 AM

Hi All, I have written a sample program to connect a site and get the information from there using the "java.net.URL" but the problem is the site is in "https" so i am getting a SSLHandShakeException : Chaining Error how to avoid this error.The site is certified by the verisign and my keystore contains the verisign class 3 certificate. here is the code that i have written URL url = new URL("https://www.myclientsite.com/Training/Request.asp"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoInput(true); conn.setDoOutput(true); conn.connect(); OutputStream os = conn.g   More>>

Hi All,


I have written a sample program to connect a site and get the information from there using the "java.net.URL" but the problem is the site is in "https" so i am getting a SSLHandShakeException : Chaining Error how to avoid this error.The site is certified by the verisign and my keystore contains the verisign class 3 certificate.

here is the code that i have written

			
URL url = new URL("https://www.myclientsite.com/Training/Request.asp");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.connect();
OutputStream os = conn.getOutputStream();
os.write( "Some Input" );
os.flush();
os.close();
InputStream is = conn.getInputStream();
byte[] bytes = new byte[1024];
StringBuffer buffer = new StringBuffer();
while( is.read( bytes ) != -1){
buffer.append( new String( bytes ) );
}
is.close();
String response = buffer.toString();
System.out.println(response);



Any help will be appreciated



Regards,

Krishna Rajendra A.    <<Less
About | Sitemap | Contact