This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception java.io.IOException: HTTPS hostname wrong:  RSS feed

 
vasu devan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
When I tried to contact a servlet from another servlet through https using the URL Connection and I have also used InetAddress class. When I executed the code I am getting the following error.

Exception java.io.IOException: HTTPS hostname wrong: should be <100.101.100.57>, but cert says <weblogic.bea.com>

For ur information we are using weblogic democert in the server.
We are calling the servlet using the IP address.
(i.e https://IPAddress ort/MyServlet)
How to overcome this problem. Please do suggest me some thing regarding this.
Thanks in Advance
Vasu.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer, I think, is in the thread you started earlier and also the one linked to by JB.
- Peter
 
vasu devan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Junaid Bhatra and Peter den Haan,
Thank you very much for ur reply.
My requirement is to post the values to a servlet through https using URL connection.
1. First I tried using servlet.
i.e From one servlet I was trying to post the values to another servlet using URL connection.
For this as you suggested I tried both the method,
one that disable the host name verification altogether.
The other method using the IneAddress class to make the comparison of the host name.
In both the casses I am getting the error

Exception java.io.IOException: Server Certificate SubjectDN

So I tried to post the values using the normal java class to servlet.
In this case by using the InetAddress class I could post the value.But in the servlet I am redirecting the response to another servlet using response.sendRedirect(url). My problem is I am not able to redirect it to another servlet.
For ur info redirection is done using http only.
The above metioned scenario works for http post.
Could you help me to solve this, as this is very urgent for me.
If I am not able to explain to you properly, if need be I will post my code also. Do suggest me some thing.
Thanks in Advance
Vasu.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!