How to set up Java VM to use the root certificates (truststore) handled by Mac OS X(如何设置 Java VM 以使用 Mac OS X 处理的根证书(信任库))
问题描述
我在使用 scribe OAuth 库时遇到以下异常.
I get the following exception while using the scribe OAuth library.
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
根据一些谷歌搜索,我似乎应该以某种方式设置 JVM 信任库.
Based on some googling it seems I should set up the JVM truststore somehow.
为什么我需要这样做?如何指示 Java VM 使用操作系统的默认信任库?(在我的例子中是 Mac OS X).
Why do I need to do this? How can I instruct the Java VM to use the default truststore of the os? (Mac OS X in my case).
推荐答案
我可以通过在启动 VM 时添加此系统属性来设置默认信任库:
I can setup the default truststore by adding this system propery when launching the VM:
-Djavax.net.ssl.trustStore=/Library/Java/Home/lib/security/cacerts
我仍然不明白为什么我需要这样做.这应该是默认值.每次添加这个也很烦人.有没有更好的方法,例如一些操作系统设置?
I still don't understand why do I need to do this. This should be the default. It's also very annoying to add this every time. Is there a better way, e.g. some OS settings?
这篇关于如何设置 Java VM 以使用 Mac OS X 处理的根证书(信任库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何设置 Java VM 以使用 Mac OS X 处理的根证书(信任库)
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
