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 中的别名的单个证书
基础教程推荐
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
