0

My question is basically to resolve a SSLException due to use of wildcard certificates in my web service calls. Now before people redirect me to any existing SO questions, please note that I am aware of using/creating a Custom hostnameverifier and setting it in weblogic.

My main problem is that since my application runs on a shared weblogic server, I am not allowed to do any changes to weblogic config.xml file. So, I need to do the host name verifier setting in my java code somehow. I came across this question which describes how to write a custom HttpsURLConnection class.

Question: Now I don't understand how to call my web service methods (using a custom SoapConnection class) from DataOutputStream's writeBytes method?

Note:
1. Above linked question is ignoring the SSL validation. I will not do that. I found a class that allows wildcard certificate host names.
2. I forgot to mention that I am using weblogic 10.3.2.0 which does not allow wildcard certificates by default.

Community
  • 1
  • 1
gsonal
  • 11
  • 1
  • 6
  • How do you call your web server? I use RestTemplate, and I can explain how to do it using RestTemplate. For other ways of creating the HttpsURLConnection, I would need to understand how you create the connection. – Avi Apr 15 '13 at 13:51
  • I am using connection class provided by the web service itself. We pass username, password and a hostname to the class. Its via SOAP. – gsonal Apr 15 '13 at 14:00
  • Usually you need to configure the class which creates the connection with a factory that will build your own custom https connection. – Avi Apr 15 '13 at 14:02
  • Have a look at a question I asked not so long ago in which I explained how I built the connection. You need to convert what I did with RestTemplate, to your way of building connections: http://stackoverflow.com/questions/15544116/sslhandshakeexception-received-fatal-alert-handshake-failure-when-setting-ciph – Avi Apr 15 '13 at 14:03
  • Actuallty, I have seen your post before too. You are modifying server.xml and I cannot modify any weblogic config files. – gsonal Apr 15 '13 at 14:10
  • That's not the issue here. Look at the java code in which I create a custom HTTP client and modify HttpsURLConnection to use my verifier. You need your own verifier. – Avi Apr 15 '13 at 14:12
  • Can you move the discussion to chat? I am getting warning everytime I try to post a comment? – gsonal Apr 15 '13 at 14:17
  • I understand till the point that we can specify our own verifer class in HTTP client. But again my main question: How do I call web service method after creating the Httpurlconnection? – gsonal Apr 15 '13 at 14:21
  • I have to admin that I'm not familiar with you're way of doing things so I'm not sure how to further continue from here. – Avi Apr 15 '13 at 14:22

0 Answers0