我正在从 matlab 调用 java 函数。该函数在 eclipse 中运行良好,但是当我从 matlab 调用时,出现此异常:
java.io.IOException: The issuer can not be found in the trusted CA list.
异常发生在第二行:
URLConnection Conn = URL("https://www.google.com/accounts/ServiceLoginBoxAuth").openConnection();
Conn.getInputStream();
为什么会这样呢?有什么解决办法吗?
最佳答案
该错误意味着在尝试建立 HTTPS 连接时,无法在运行 Mathlab 时使用的 JVM 使用的证书颁发机构列表中检索到 Google 提供的证书颁发者。
您应该首先确定 Mathlab 在运行时使用哪个 JVM,然后找到该 JVM 的证书颁发机构列表,通常位于 {jre_home}/lib/security/cacerts
然后您应该将 Google 证书颁发机构(我不知道他们使用谁)添加到该列表中(使用 key 工具: http://nl.globalsign.com/en/support/ssl+certificates/java/java+based+webserver/keytool+commands/ )
基本上,您需要找到该机构的证书(*.crt 文件)
您可以通过确保 Mathlab 使用更新的 JVM 来绕过此问题(看起来您用来运行 Eclipse 的 JVM 确实有此证书)
关于java - Matlab java接口(interface): java. io.IOException : The issuer can not be found in the trusted CA list?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8740871/