如何设置 Java VM 以使用 Mac OS X 处理的根证书(信任库) [英] How to set up Java VM to use the root certificates (truststore) handled by Mac OS X

查看:33
本文介绍了如何设置 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 处理的根证书(信任库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆