Using a single certificate based on aliases from Java Key Store(使用基于 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
属性.
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 中的别名的单个证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用基于 Java Key Store 中的别名的单个证书


- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 获取数字的最后一位 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 转换 ldap 日期 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01