The Artima Developer Community
Sponsored Link

Web Services Forum
Authentication web services

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
patillaldi

Posts: 1
Nickname: patillaldi
Registered: Jun, 2005

Authentication web services Posted: Jun 14, 2005 1:41 AM
Reply to this message Reply
Advertisement
I'm developing a web service who has to query other web services using a security certificates.
The remote web service calls are executed from different threads (simultaneous calls).

Which is the best way to implement security here?

When I access a single web service there is no problem. But when I try to access a second one I get the following:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java: 224)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:157)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:114)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)

This is the code I use to add the security certificates:

Web Service 1:

System.setProperty('java.protocol.handler.pkgs', 'com.sun.net.ssl.internal.www.protocol');
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty('javax.net.ssl.keyStore', 'testkeystore.jks');
System.setProperty('javax.net.ssl.keyStorePassword','my_password');
System.setProperty('javax.net.ssl.trustStore','testtrustore.jks');
System.setProperty('javax.net.ssl.trustStorePassword','my_password');

Web Service 2:

System.setProperty('java.protocol.handler.pkgs', 'com.sun.net.ssl.internal.www.protocol');
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty('javax.net.ssl.key Store', 'mio.keystore');
System.setProperty('javax.net.ssl.keyStorePassword','password');
System.setPro perty('javax.net.ssl.trustStore','mio.trustore');
System.setProperty('javax.net. ssl.trustStorePassword','password');

I think the problem comes when I try to put the second System property set, they overwrite the first one and then one of the threads ends up "distrusting" the remote certificate.

Is there any way to merge both key stores and both trust stores? If so, could you add some code?

Thanks in advance.

Topic: a problem with JDBC and Web Service Previous Topic   Next Topic Topic: NetApp Filer Help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use