Las propiedades SSL se establecen en el nivel JVM a través de las propiedades del sistema. Lo que significa que puede establecerlos cuando ejecuta el programa (java -D ....) O puede establecerlos en el código haciendo System.setProperty.
javax.net.ssl.keyStore- Location of the Java keystore file containing an application process's own certificate and private key. On Windows, the specified pathname must use forward slashes, /, in place of backslashes.
javax.net.ssl.keyStorePassword - Password to access the private key from the keystore file specified by javax.net.ssl.keyStore. This password is used twice: To unlock the keystore file (store password), and To decrypt the private key stored in the keystore (key password).
javax.net.ssl.trustStore - Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store). On Windows, the specified pathname must use forward slashes, /
, in place of backslashes, \
.
If a trust store location is not specified using this property, the SunJSSE implementation searches for and uses a keystore file in the following locations (in order):
$JAVA_HOME/lib/security/jssecacerts
$JAVA_HOME/lib/security/cacerts
javax.net.ssl.trustStorePassword - Password to unlock the keystore file (store password) specified by javax.net.ssl.trustStore
.
javax.net.ssl.trustStoreType - (Optional) For Java keystore file format, this property has the value jks (or JKS). You do not normally specify this property, because its default value is already jks.
javax.net.debug - To switch on logging for the SSL/TLS layer, set this property to ssl.
System.setProperty ("javax.net.ssl.trustStore", path_to_your_jks_file); – djangofan
¿Alguien sabe cómo hacer referencia a esto en un cuadro de Windows? System.setProperty ("javax.net.ssl.trustStore", "C: \\ Archivos de programa (x86) \\ Java \\ jdk1.7.0_21 \\ jre \\ lib \\ security \\ cacerts"); no funciona para mí :( – simgineer
¿ha intentado también escapar de los espacios? – DaveH