Ignore chain certificates when listing end entity certificate in keystore. In the JKS, if there are more than 1 trusted ca cert, then the end entities are automatically added with their respective chain when displayed.
So it is important to take only the first certificate and add it to the list. Chains will be ignored during this step. But Since the ca certs are also part of the trustedCertEntry entity, it will be added when the code sees the data.
Ignore chain certificates when listing end entity certificate in keystore. In the JKS, if there are more than 1 trusted ca cert, then the end entities are automatically added with their respective chain when displayed. So it is important to take only the first certificate and add it to the list. Chains will be ignored during this step. But Since the ca certs are also part of the trustedCertEntry entity, it will be added when the code sees the data.