I have a custom SSL factory, where I load my own truststore.
Now when I put the truststore.jks file into the project root folder, it works with the following line:
ks.load(new FileInputStream("/truststore.jks", passphrase);
But I want my truststore inside my resource folder, which was built with maven where the path is src/main/resources.
Then I do and it doesn't work with the following line:
ks.load(this.getClass().getResourcesAsStream("/truststore.jks"), passphrase);
Though the input stream exists. I checked it. It only fails when I do ks.load(...).
The exception that I get is:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Why is that?
Regards, Dave