I would like to set custom truststore for my application. I would like to use System.setProperty(). Set in tomcat is not an option.
All the configurations seems to be good, but it doesn't work. I use Spring boot 2.0.6, with external tomcat.
I tried different places to configure, like in Bean's Postconstruct, just before SpringApplication.run. Here is my most recent code:
static {
System.setProperty("javax.net.debug", "all");
System.setProperty("javax.net.ssl.trustStore", "/opt/grtc8/profiles/appconf/insurance/https-trust.p12");
System.setProperty("javax.net.ssl.trustStorePassword", "xys");
System.setProperty("javax.net.ssl.trustStoreType", "PKCS12");
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(InsuranceCalculatorApplication.class);
}
public static void main(String[] args){
SpringApplication.run(InsuranceCalculatorApplication.class, args);
}
I have a cert exception, it seems, that it not reading the file, or something.
I'm using Tomcat 8.5.