Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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 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
Boost this thread!