In my Spring boot application, I need to call an API (GET: https://anotherserver.com/api
) on another server. The server admin gave me a file named cacerts
(no extension), and told me to import the file using VM options every time I start my Spring boot application.
-Djavax.net.ssl.trustStore=C:\Users\k26342\Downloads\cacerts -Djavax.net.ssl.trustStorePassword=changeit
It did work. Now I want to write some code to do so instead of using VM options but I have no idea how. I found some posts (like this and this) but the posts are about keystore
or X509Certificate
which I think are different from my case.
Any help is appreciated.