java 中的 SSL 可信证书

SSL trusted certificates in java

我们是否需要将受信任的 CA 证书显式导入 java 密钥库?如果是这样,那为什么呢?

我能理解我们应该始终将自签名 SSL 证书导入密钥库,因为它们未经验证并且 java 不能信任除非它在密钥库中。但是我们是否需要对可信 CA 生产证书进行同样的操作?

注意:我使用的是 jdk v1.6.x.

没关系,如果你使用自签名证书或CA证书。您需要将其导入到信任库(可以是与密钥库相同的文件),以便您的 java 应用程序可以使用它。 Java 本身不会从 Internet 加载任何受信任的证书,因为它不知道可以信任哪些站点,哪些站点不能。

I can understand that we should always import the Self-Signed SSL certificates into the keystore, because they are not verified ones and java can't trust unless it's there in the keystore.

信任商店。

But do we need to exercise the same thing even for Trusted CA Production Certificates?

没有。如果 CA 已被 Java 信任库信任,则您无需执行任何操作。