This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes certificate problem between two jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "certificate problem between two jsps" Watch "certificate problem between two jsps" New topic
Author

certificate problem between two jsps

lolo lolailo
Greenhorn

Joined: Jan 14, 2003
Posts: 3
Hi, I'm improving an app that runs on a wlserver6.1. I'm trying to add an SSL implementation so the jsp accessed are transfer through a secure connection. I've implemented the web.xml like this:
**************************************************
<security-constraint>
<web-resource-collection>
<web-resource-name>MyApp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
**************************************************
And it works fine when I execute a stupid jsp like HelloWorld (inside a HelloWorld.jsp) with a call to https://localhost:7002/myapp/HelloWorld.jsp
Great! 2nd level complexity is when I try to make a connection (inside a jsp that has a dispatcher role)to another jsp
URL url = new URL(response.encodeURL("https://localhost:7002/myapp/" + op.getJsp()));
URLConnection uc = url.openConnection();
uc.setDoOutput(true);
uc.setUseCaches(false);
PrintStream outStream = new PrintStream(uc.getOutputStream());
it crashes with this stacktrace:
java.io.IOException: Certificate SubjectDN CommonName received does not match server hostname at weblogic.security.SSL.SSLSocket.clientInit(SSLSocket.java:454)
at weblogic.security.SSL.SSLSocket.initialize(SSLSocket.java:265)
at weblogic.security.SSL.SSLSocket.<init>(SSLSocket.java:212)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:85)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:143)
at weblogic.net.http.HttpsClient.<init>(HttpsClient.java:67)
at weblogic.net.http.HttpClient.New(HttpClient.java:151)
at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:39)
at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection
.java:156)
at jsp_servlet.__operacion._jspService(__operacion.java:170)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
Thanks
lolo lolailo
Greenhorn

Joined: Jan 14, 2003
Posts: 3
Great, found myself an answer!!!
I've got to disable the checkbox Ignore Hostname Verification.
I'll now try the SSL with a new certificate (not the demo one).
Thanks!!!
 
GeeCON Prague 2014
 
subject: certificate problem between two jsps