Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem while posting information using URLConnection

Nathan KV
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 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 ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic