Using a single certificate based on aliases from the Java Key Store

I have a keystore in which several keys and certificates are added. I want to use a certificate based on aliases from the keystore 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 key aliases

+4
source share
1 answer

If you look at the Customization section of the JSSE Reference Guide (or the entire guide), there is no javax.net.ssl.keyAlias or javax.net.ssl.keyStoreAlias .

This application should choose how to select the desired certificate using its alias, but it must download it itself. Some frameworks use their own properties or configuration parameters.

+5
source

Source: https://habr.com/ru/post/1438862/


All Articles