How to find the current power of attorney on the disk programmatically?

Is there any function that tells me which current trust store is used in my program. On Windows, the default trust store is located in JAVA_HOME \ lib \ security \ cacerts.

However, the default value can be changed in various ways.

  • -Djavax.net.ssl.keyStoreCommand line usage

  • Using a class Keystore.

  • If the program is running on the application server under which the application is launched, you can set the storage path through the panel.

  • If the program is running on Tomcat, then Tomcat settings may change the trust store.

and many other ways.

Is there a software way by which I can find out the drive path in a trusted store that is currently active?

+1
source share
1 answer

Generally speaking, you cannot (this is very similar to this question ).

In the JSSE API, certificate trust is not actually defined by the trust store, but. Although it is often initialized with a truststore, it is not necessary. In addition, the repositories themselves should not be files . There is nothing in the default trust API to check where and how the potential trust store is used.

There SSLSocketis nothing that allows you to return to it SSLSocketFactory, and nothing where you can return to the original SSLContext, and nothing there that allows you to get trustees.

/ , . , , , SSLContext, javax.net.ssl.*. SSLContext ( , Tomcat , ).

Java 6, () SSLContext ( SSLContext.setDefault(...).

, JSSE. . -Djavax.net.debug=SSL,trustmanager , , API.

(, -Djavax.net.ssl.keyStore , ).

+7

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


All Articles