• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while posting information using URLConnection  RSS feed

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
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();
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 ]
What a show! What atmosphere! What fun! What a tiny ad!
Why should you try IntelliJ IDEA ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!