• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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 ]
I'm so happy! And I wish to make this tiny ad happy too:
Become a Java guru with IntelliJ IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!