I am in the impression that once I set system properties when I get SSLContext.getDefault() should return me SSLContext with those set properties. In the following case should be with specified keyStore. Unfortunately that's not what is happening. It falls back JVM's default keystore. Am I missing something ?
System.setProperty("javax.net.ssl.keyStore", "/valida-location/keyStore.jks");
System.setProperty("javax.net.ssl.keyStorePassword","changeit");
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
answer = SSLContext.getDefault();
-Djavax.net.debug=ssl'? Does it show that it reads/keyStore.jks?keyStore is : keyStore type is : jks keyStore provider is : init keystore init keymanager of type SunX509 trigger seeding of SecureRandom done seeding SecureRandom Allow unsafe renegotiation: false Allow legacy hello messages: trueThis is what I get in logs @KarolDowbecki-Dproperties instead ofSystem.setProperty()? I'm trying to confirm if your keystore location and password is correct./keyStore.jksreally in your system's root directory (or on Windows the drive's)?