Error when sending JSONRequest

Posted by smartsysISV on 10-Dec-2015 12:33

If i try to use rbv_api.sendJSONRequest i get an error

ex:

headers["Authorization"]="Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
var onehublistfilesurl="ws-api.onehub.com/.../1038835141.json";
var dirlist=rbv_api.sendJSONRequest(onehublistfilesurl, null, "GET", null, null, null, headers);

I get this error form Rollbase:

"unable to find valid certification path to requested target (line #6) in formula"

It is no problem to get the correct answer when i use "Advanced Rest Client Application" to test this in Chrome?

Any suggestions?

Posted by Anoop Premachandran on 21-Dec-2015 20:24

This is fixed now. Please try now

All Replies

Posted by egarcia on 10-Dec-2015 13:03

Hello,

Just a quick reply.

The error message seems to suggest that that the Rollbase instance is not aware of the SSL certificate.

Perhaps, there might be a way that you could register the certificate so that it recognizes it.

BTW, why is the Authorization header using "Bearer" instead of "Basic"? Are you implementing your own authentication?

If you are using regular BASIC authentication, then you should be able to use the username and password parameters.

I hope this helps.

Posted by Varun Tayal on 11-Dec-2015 02:48

I think you need to import the ssl certificate to the trusted store. Check this out - blogs.oracle.com/.../unable_to_find_valid_certification

OR

After I debug this I found the exact exception and solution

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Here is the same issue discussed on Stackoverflow-

http://stackoverflow.com/questions/9619030/resolving-javax-net-ssl-sslhandshakeexception-sun-security-validator-validatore

Since Smartsys is on public hosting, Please log a case with support.

Posted by Varun Tayal on 11-Dec-2015 06:27

BTW the link you were trying to hit is basically secured by a certificate signed by Go Daddy.

So just an FYI-

This is why it is not working: tozny.com/.../godaddys-ssl-certs-dont-work-in-java-the-right-solution

If the java client is running inside a JRE 8 then it automatically fixes the problem.

Posted by smartsysISV on 11-Dec-2015 07:08

Thank you, then this is the reaseon why it Works in a browser.

But how can i fix this, so i can use a trigger in a batch-job form Rollbase?

Can you help me to clearify this?

Posted by Anoop Premachandran on 11-Dec-2015 09:24

This has to be fixed by us. Please raise a support case

Posted by smartsysISV on 11-Dec-2015 10:03

A supportcase was registred yesterday. Se casno: 332446.

When can this be fixed???

Posted by Mani Kumar on 14-Dec-2015 05:22

A defect # 29036  has been logged against this issue.

Will update you soon with more details on fix.

-Mani.

Posted by Anoop Premachandran on 21-Dec-2015 20:24

This is fixed now. Please try now

This thread is closed