No trusted certificate found

I am trying to run the sample code in Control-9.0\sdk\samples\soap\java\apache\axis\LocalLB.

1) Before running the test I created a self-signed certificate on the BIG-IP setting the fully qualified host name of the BIG-IP admin facility as the CN of the certificate.

2) I then copied the .crt file to my local machine and imported it into the keystore file using the keytool utilty.

3) When I ran the code I received the following error:

May 4, 2005 1:55:47 PM org.apache.axis.utils.JavaUtils isAttachmentSupported

WARNING: Unable to find required classes (javax.activation.DataHandler and javax

.mail.internet.MimeMultipart). Attachment support is disabled.

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString: javax.net.ssl.SSLHandshakeException: sun.security.validator.Valida

torException: No trusted certificate found

faultActor:

faultNode:

faultDetail:

{WebServices - Axis}stackTrace:javax.net.ssl.SSLHandshakeExcept

ion: sun.security.validator.ValidatorException: No trusted certificate found

What do I need to do to resolve this problem?

Thanks,

David

Historically, you would have to have installed the server certificate in your client truststore (Click here)

But, thanks to one of our users, we’ve now got a much easier way.

Take a look at the following forum thread for more info : Click here

I’ve tested his class with both Apache Axis and WSSOAP for both v4.x and 9.x of our products. Feel free to post if you have any issues getting it going.

BTW, The upcoming v9.2 of the SDK will include this code.

-Joe

This triggers two questions.

1) I did follow the brute force approach and installed the certificate in the keystore file, and it still failed with “No trusted certificate found”. Any ideas?

2) I am also ready to give XTrustProvider.java a try. Please provide detailed instructions on how to implement this class. Where should it be deployed and built. Where and how should it be called in the SOAP code to bypass certificate authorization.

Thanks,

David

Not sure why the brute force approach didn’t work. More than likely you didn’t install the certificate into the file specified in the app.

System.setProperty("javax.net.ssl.trustStore", 
   System.getProperty("user.home") + "/.keystore");

For the automagic solution, just include the specified code in the referenced post post in your project, then from within your application, include the following line somewhere in the initialization.

Provider.install("MYX509ALG")

or if you use the version from CodeShare, I believe the class was renamed to XProvider (or something like that).

If you get stuck, you can download the iControl 4.6.3 SDK which includes this code and shows it’s usage. We’ll include it as well in the upcoming v9.2 version.

-Joe

How would this be done for Axis?

Excellent! Glad to be of some help. Feel free to post again if anything comes up that you need assistance on.

-Joe

I have two JAVA application.

1) Java Batch Application where application intereact with BIGIP to get VS, Pool and Members. Also gets STATUS for all the members.

In this program I am using “XTrustProvider.java” and call “XTrustProvider.install()” in my class contructor. It is working just fine.

2) Java Web application running on another Unix server, This application is designed to ENABLED or DISABLED pool member as per user request. In this program I am using same “XTrustProvider.java” and calling “XTrustProvider.install()”, but here I am getting following Error Message:

[11/17/05 13:22:04:041 EST] 187f194 SystemOut O AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString: javax.net.ssl.SSLHandshakeException: unknown certificate

faultActor:

faultNode:

faultDetail:

{WebServices - Axis}stackTrace:javax.net.ssl.SSLHandshakeException: unknown certificate

at com.ibm.jsse.bs.a(Unknown Source)

at com.ibm.jsse.bs.startHandshake(Unknown Source)

at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)

at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)

at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

at org.apache.axis.client.Call.invokeEngine(Call.java:2765)

at org.apache.axis.client.Call.invoke(Call.java:2748)

at org.apache.axis.client.Call.invoke(Call.java:2424)

at org.apache.axis.client.Call.invoke(Call.java:2347)

at org.apache.axis.client.Call.invoke(Call.java:1804)

at iControl.LocalLBVirtualServerBindingStub.get_list(LocalLBVirtualServerBindingStub.java:1990)

at com.vanguard.wsdmon.core.ChangeBigIPData.doUpdate(ChangeBigIPData.java:126)

at com.vanguard.wsdmon.core.ChangeBigIPData.UpdateData(ChangeBigIPData.java:232)

at com.vanguard.wsdmon.core.WSDAction.doWSDAction(WSDAction.java:424)

at com.vanguard.wsdmon.core.WSDMonitor.doPost(WSDMonitor.java:212)

at com.vanguard.wsdmon.core.WSDMonitor.doGet(WSDMonitor.java:437)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at com.vanguard.services.servlet.http.VgBaseServlet.vgiserviceImpl(Unknown Source)

at com.vanguard.services.servlet.http.VgBaseServlet.service(Unknown Source)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)

at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)

at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)

at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)

at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)

at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)

at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)

at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)

at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)

at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)

at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)

at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)

at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)

at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)

at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)

at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)

at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)

at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)

at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)

{WebServices - Axis}hostname:dssva003

[11/17/05 13:22:04:043 EST] 187f194 SystemOut O javax.net.ssl.SSLHandshakeException: unknown certificate

3

Please help to resolve this.

It looks like you are using WebSphere for your deployment of your web app. Are you using the same framework for your standalone application that is currently working?

I have almost no working knowledge of websphere so I wouldn’t really know where to start in trying to help you out here. I do know that IBM has their own JSSE provider that overrides suns. I’m not sure if this is causing an issue with the XTrustProvider class or not. Is there any chance you are not calling the install() method within the context of the applications request?

Anyone out there deployed a web based application with WebSphere that uses iControl on the backend?

-Joe

Hi Joe,

The standalone application is also configured in WebSphere. It is running on my Desktop. I run this application via web browser “http://:9080”. This application connects to BIGIP without any issue using XTrustProvider.java.

If I run another standalone application also configured in different instance of a WebSphere on my desktop running on diffrent port. This application is also using same XTrustProvider and tries to connect to the same BIGIP. I run this application via web browser “http://:9084”. This application gives me the error I have posted earlier.

is same for both application.

Do I need to make any changes to XTrustProvider utility in order for it to work for my other application.

Please help.

Hi Joe,

I am planning to use “installCert.java” program to install certificate on the client in order for it to connect to BigIP server.

I would appreciate if you provide reply to following questions:

1) In order to run installCert program what should I provide as arguments:

server ( I assume this will be BigIP Name, correct??)

keystore_password

keystore_alias

2) Once I install the ceritficate, I need to make some modification to my GetBigIPData.java, Please verify following is correct:

I will remove following line from my GetBigIPData.java constructor:

XTrustProvider.install();

I will add following lines in my GetBigIPData.java constructor:

System.setProperty(“javax.net.ssl.trustStore”, System.getProperty(“user.home”) + “/.keystore”);

Please let me know if I need to make any additional modifications.

Hoping for an early reply.

Thanks,

-Sunit

You don’t need to use both the XTrustProvider and installCert utility. The XTrustProvider provides a real-time injection into the certificate validation process while installCert will take the server certificate and physically install it into your local trust store.

So, here’s the flow (simplistic version):

1) client requests connection with BIG-IP

2) BIG-IP sends back it’s server certificate

3) Client library checks the issuer, date, etc from the certificate to make sure it’s valid and allowed.

3.a) For signing authorities that are not trusted, the client library will look into the local truststore to see if that certificate is present. If so, a connection is allowed. This is what installCert.java will do for you.

3.b) If the certificate isn’t found in the local truststore, call the lower JSSE libraries validation routines. It is here that XTrustProvider injects itself into the processing and tells the JSSE layer to trust the certificate.

As you can see, you only need one of the tho options. Using the XTrustProvider is the preferred method as it requires no clientside configuration or setup. If, for some reason, you aren’t able to get that working, the client side trust store option is always there.

-Joe

Joe,

Since “XTrustProvider.java” is not working for me on WebSphere running on Solaris Box. I want to try “installCert.java”.

Once we mannually install certificate on BigIP and same Certificate on our Solaris box from where we are trying to connect to BigIP, What changes do I need to make in my code.?

Currently my code is using “XTrustProvider.java”. I am calling “XTrustProvider.install()” in GetBigIPData.java constructor.

I would appreciate if you let me know what steps do I need to take to use “installCert.java” or Can I use same existing code and it will use mannually installed certificate?

Thanks,

Hi dnewman,

I am using XtrusProvider running with Axis. I am running my application on WebSphere. When I test my application in WebSphere Studio Application Developer (WSAD) running on my Desktop it working fine. But When I deploy my same application to our DEV environment which has WebSphere Application server running on Solaris, Same application complains about “unknown Certificate”.

I would appreciate if you let us know your configuration if you also use Websphere on Solaris.

Thanks

As I said, XTrustProvider and installCert are two different options. You don’t need to use them both. If for some reason you are having problems with XTrustProvider working in real-time, then here’s how installCert works.

Run java installCert bigip_address keystore_password keystore_alias

Where

bigip_address is the ip address of the BIG-IP

keystore_password is the password of your local keystore {user.home}/.keystore

keystore_alias is the alias for the new entry in your keystore.

If you need help creating a keystore, take a look a the documentation for sun’s keytool command.

Then in your client code you will need to specify the location of the keystore.

System.setProperty("javax.net.ssl.trustStore", System.getProperty("user.home") + "/.keystore");

Here is probably where a potential problem could lie. If your “user.home” variable is different in the context of running the installCert command and the context of your web application, then this will not work. You might want to hardcode a location in your app to the real location of the keystore.

System.setProperty("javax.net.ssl.trustStore", "/full/path/to/.keystore");

And make sure that the identity your webserver is running under has access to that file.

-Joe

Hi Joe,

Thanks for the reply. I didn’t have any “.keystore” file in my {user.home} directory. I created this file. Now I don’t know what password I should provide.

Please let me know what will be the password.

I have tried following as passwords:

“changeit”

“”

Both of them doesn’t work.

Please help…

Thanks

This is a special kind of file similar to a vault. You cannot create an empty file. You must use the keytool command to create the file. The keystore_password is the password you specified for the file when you created it with keytool.

After the empty password protected keystore is created, you can use installCert to install server certificates in there.

Check the keytool man page for it’s usage. Reading through that should give you a good overview of keystores. Or, do a google search on keytool and that should point you in the right direction.

-Joe

Hi Joe,

I tried with XtrustProvider, but I am getting the below exception now. Is there any solution to come across.

Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl) at java.security.Provider$Service.newInstance(Provider.java:1245) at sun.security.jca.GetInstance.getInstance(GetInstance.java:220) at sun.security.jca.GetInstance.getInstance(GetInstance.java:147) at javax.net.ssl.SSLContext.getInstance(SSLContext.java:125) at javax.net.ssl.SSLContext.getDefault(SSLContext.java:68) at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:102) at org.apache.axis.components.net.JSSESocketFactory.initFactory(JSSESocketFactory.java:87) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:105) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at iControl.SystemSessionBindingStub.set_recursive_query_state(SystemSessionBindingStub.java:778) at com.cloupia.lib.cIaaS.loadBalancers.F5LoadBalancerAPI.(F5LoadBalancerAPI.java:90) at com.cloupia.lib.cIaaS.loadBalancers.F5LoadBalancerAPI.getF5LBAPI(F5LoadBalancerAPI.java:118) at com.cloupia.feature.f5LoadBalancer.F5LBAccountTestConnectivityHandler.testConnection(F5LBAccountTestConnectivityHandler.java:35) … 17 more Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38) at java.security.KeyStore.load(KeyStore.java:1185) at com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl.getCacertsKeyStore(TrustManagerFactoryImpl.java:202) at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.getDefaultTrustManager(DefaultSSLContextImpl.java:70) at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.(DefaultSSLContextImpl.java:40) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at java.security.Provider$Service.newInstance(Provider.java:1221) … 40 more Caused by: java.security.UnrecoverableKeyException: Password verification failed

Regards, PRakash.K