Using a single certificate based on aliases from Java Key Store

时间秒杀一切 提交于 2019-12-30 09:36:47

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/12817002/using-a-single-certificate-based-on-aliases-from-java-key-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!