使用基于Java Key Store别名的单个证书 [英] Using a single certificate based on aliases from Java Key Store
问题描述
我有一个密钥库,其中添加了多个密钥和证书
我想使用基于密钥库别名的证书并将其用于SSL
我试图设置以下系统属性,但没有任何帮助
I have a keystore which has multiple keys and certificates added to it I want to used a certificate based on the aliases from the key store and use it for SSL I tried to set the following System properties but nothing helped
System.setProperty("javax.net.ssl.keyAlias", "abcd");
System.setProperty("javax.net.ssl.keyStoreAlias", "abcd");
它总是使用密钥库中的第一个证书而不是匹配密钥别名
It always uses the first certificate from the keystore instead of matching the key aliases
推荐答案
如果你看一下 JSSE参考指南的定制部分(或整个指南),没有 javax.net.ssl.keyAlias
或者 javax.net.ssl.keyStoreAlias
property。
If you look at the Customization section of the JSSE Reference Guide (or the entire guide), there's no javax.net.ssl.keyAlias
or javax.net.ssl.keyStoreAlias
property.
应用程序可以选择哪种方式它想要的证书,使用其别名,但它必须自己显式加载它。一些框架使用自己的属性或配置选项。
It's up to the application to have a way to select which certificate it wants, using its alias name, but it has to load it explicitly itself. Some frameworks use their own properties or configuration options.
这篇关于使用基于Java Key Store别名的单个证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!