Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while posting information using URLConnection  RSS feed

 
Nathan KV
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all,
I want to post some information from one servlet to another servlet through coding (not through browser)
This i tried in 2 ways :
Method 1. By using the JSSE
Method 2. Without using JSSE
And in the both ways i got the following exception
Exception java.io.IOException: Server Certificate SubjectDN CommonName received does not match Server hostname

Method 1

Please refer the link
http://www.coderanch.com/t/354489/Servlets/java/IOException-Server-Certificate-SubjectDN
for the JSSE method

----------------------------

Method 2

This is the code i used in servlet to contact the another servlet in https mode
---------------------
URL oUrl = new URL(sUrl);
URLConnection urlCon = oUrl.openConnection();
urlCon.setDoOutput(true);
urlCon.setUseCaches(false);
DataOutputStream outStream = new DataOutputStream(urlCon.getOutputStream());
String sFinalMessage = URLEncoder.encode("Msg")+"="+URLEncoder.encode("My Message");
------------------------
In this method, when i tried to contact the another servlet through http it is working.

But through https it is not working

Please suggest something
[ May 07, 2002: Message edited by: Nathan KV ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!