Matlab java interface: java.io.IOException: The issuer can not be found in the trusted CA list?

StackOverflow https://stackoverflow.com/questions/8740971

  •  14-04-2021
  •  | 
  •  

Question

I am calling java function from matlab. The function is running fine in eclipse but when I call in from matlab I get this exception:

java.io.IOException: The issuer can not be found in the trusted CA list.

The exception occurs at the second line:

URLConnection Conn = URL("https://www.google.com/accounts/ServiceLoginBoxAuth").openConnection();
Conn.getInputStream();

Why is it so? Any solution?

Was it helpful?

Solution 2

If you use the java's URL class in matlab you would have to pass the handler.
I used this constructor:

URL(null, ServiceLoginBoxAuthUri, sun.net.www.protocol.https.Handler);  

and it worked fine.

Note: sun.net.www.protocol.https.Handler is only available in matlab

OTHER TIPS

The error means that while trying to establish the HTTPS connection, the issuer of the certificate provided by Google couldn't be retrieved in the Certificate authority list used by the JVM used when running Mathlab.

You should first identify exactly which JVM is used by Mathlab when running, then find the certificate authority list of that JVM, usually in {jre_home}/lib/security/cacerts

Then you should add Google certificate authority (I don't know who they use) to that list (using the keytool : http://nl.globalsign.com/en/support/ssl+certificates/java/java+based+webserver/keytool+commands/ )

Basically you need to find the certificate of that authority (*.crt file)

You may bypass this problem by making sure Mathlab uses a more recent JVM (it seems the one you use to run Eclipse does have this certificate)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top