1

I am receiving the following error while trying to connect my REST webservice using HTTP adapter in IBM Mobile First:

"errors": [ "Runtime: Http request failed: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty"

I am passing the user id and password in a base64 encoded format in the headers section of my input.

How do I resolve this error?

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46
Sreeks
  • 11
  • 1
  • 2
  • 1
    Can you please add some relevant parts of your code to your question? – qwerty_so Feb 17 '15 at 00:04
  • possible duplicate of [Error - trustAnchors parameter must be non-empty](http://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty) – Yoel Nunez Feb 17 '15 at 02:57
  • I have another question, is there a way I can bypass SSL validation in IBM Mobile First using HTTP adapter? I am thinking that might resolve the above issue. – Sreeks Feb 19 '15 at 04:14

2 Answers2

1

Yoel's answer got me on track: your adapter is doing an SSL request to a server that is not trusted by the keystore in your MobileFirst server.

You need to import in your server's keystore the certificate chain of the server that you are trying to reach. What I did was

  1. From Firefox, export the certificate chain in PEM format (.crt extension).
  2. In the server/conf folder of your project, import the certificate chain file. If you are using the defaults form the worklight.properties file, this will do it:

    keytool --import -keystore default.keystore -storepass worklight -file remoteServer.crt
    
xverges
  • 4,608
  • 1
  • 39
  • 60
0

This bizarre message means that the truststore you specified was not found, or couldn't be opened due to access permissions for example.

Quote from: Error - trustAnchors parameter must be non-empty

Author: @EJP

Similar question:

got java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty when using cas

Community
  • 1
  • 1
Yoel Nunez
  • 2,108
  • 1
  • 13
  • 19
  • Basically plagiarized without acknowledgement from [here](http://stackoverflow.com/a/6788682/207421). – user207421 Feb 17 '15 at 03:04
  • @EJP I did acknowledge that answer. That's why I marked this question as a duplicate of that question, check before making such statements – Yoel Nunez Feb 17 '15 at 03:11
  • Thanks for the quick response. I am trying this on my Mac. I tried to install apple Java. Also tried the other option, cd $(/usr/libexec/java_home -v 1.7)/jre/lib/security ln -fsh /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts...... But the problem still exists. – Sreeks Feb 17 '15 at 08:21