Skip to main content

problem calling https webservice

4 replies [Last post]
john7sp
Offline
Joined: 2008-09-18
Points: 0

I have a https webservice running in weblogic 9.2. While calling that I am getting
But when I write a standalone program with main() in my local machine and call the webservice its working fine !!. But when I write a client using the same code and put it inside a .war file and deploy in weblogic 9.2 server and then call,... it is giving the error.

This is what I did.
1. I generated the client using "weblogic.wsee.tools.anttasks.ClientGenTask"
2. downloaded the .der file from firefox after I accessed the wsld(https://abcserver.com/......wsdl). and created the keystore by keytool -import -alias servercert -file server.der -keystore server.keystore.
3. added in client code
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("javax.net.ssl.trustStore","....../server.keystore");
System.setProperty("javax.net.ssl.trustStorePassword","password"); and then called the webservice.

Funny thing is that with the same code if I write a stand alone client with public static void main() it is able to call the webservice properly . But if I write the same code and package it in .war file and deploy in WLS 9.2 it is giving the above mentioned error. Another thing even though I set "javax.net.ssl.trustStore" with the absolute path of server.keystore file,while I print the values in jvm, it never shows up. but all other values are properly shown.
Could any one help . plz ... it is urgent !!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
john7sp
Offline
Joined: 2008-09-18
Points: 0

I think the weblogic default configuration was overriding whatever written in the code.That's why I added the following EXTRA code.... which is working.....

System.setProperty("weblogic.security.TrustKeyStore","CustomTrust");
System.setProperty("weblogic.security.CustomTrustKeyStoreFileName",".....absolutePath...../server.keystore");

rskokan
Offline
Joined: 2003-07-02
Points: 0

Strange. I'm also having the "[Security:090477]Certificate chain received from localhost - 127.0.0.1 was not trusted causing SSL handshake failure" even though I added

System.setProperty("weblogic.security.TrustKeyStore", "CustomTrust");
System.setProperty("weblogic.security.CustomTrustKeyStoreFileName", TRUST_STORE_LOCATION);
System.setProperty("weblogic.security.CustomTrustKeyStorePassPhrase", TRUST_STORE_PASSWORD);
System.setProperty("weblogic.security.CustomTrustKeyStoreType", "JKS");
System.setProperty("weblogic.security.SSL.ignoreHostnameVerification", "true");
System.setProperty("weblogic.wsee.client.ssl.stricthostchecking", "false");
System.setProperty("weblogic.security.SSL.trustedCAKeyStore", "trustStore");

(Standalone app client works fine)

rskokan
Offline
Joined: 2003-07-02
Points: 0

Interesting. When I was setting the properties mentioned above via System.setPropert(), weblogic just ignored them.

I changed it so
- the location + pwd of the truststore file is configured in the WLS web Console
- added in WLS startup script (startWebLogic.cmd) in JAVA_OPTIONS "-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.wsee.client.ssl.stricthostchecking=false"

and it works now. I'm wondering how it is possible to specify those values programmatically.

Also, for investigating the SSL issues, it is helpful to set "-Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true -Dweblogic.security.SSL.verbose=true"

amsoto
Offline
Joined: 2012-07-10
Points: 0

Hi,

Did you solve the problem?? Because I am suffering something like you and I do not know how to fix it.

I have a CXF Web Service Client which stablish a 2 way SSL connection with the server side, loading dinamically the truststore and the keystore, and deployed in Tomcat it works perfect, but when I deploy it into a Weblogic 10.3.6 it ignores the certificates I have loaded previously to make the call to the Wer Service Client.

If someone could help me it would be great.

Thank you very much