Search code examples
javahttpsx509trustmanager

In X509TrustManager, what are method "getAcceptedIssuers" used for?


There are three method in X509TrustManager. 1 checkClientTrusted : check whether the client's certificates are trusted. 2 checkServerTrusted: check whether the server's certificates are trusted. So what the method getAcceptedIssuers for? Where it will be called?


Solution

  • getAcceptedIssuers will return a list of Certificate Authorities (CA) from the configured/available truststore. The method is called internally by checkClientTrusted and checkServerTrusted, where it will compare the CA of the incoming certificate against the list of trusted CAs as available from the TrustStore.