Starting Jar using RMI and SSL
Hello friends,
I developed a client server based program using RMI and SSL. It works fine. But I don't want to start the jar files each time with the following command:
java -Djavax.net.ssl.trustStore=server.keystore -Djavax.net.ssl.keyStore=server.keystore -Djavax.net.ssl.keyStorePassword=xy -jar server.jar
Therefore I was thinking about putting the keys inside of the server.jar and loading it from one of my classes. The code which I have implemented to load the keys from jar looks like follows:
URL trustStore = ClassLoader.getSystemResource("server.keystore");
System.setProperty("Djavax.net.ssl.trustStore", trustStore.toExternalForm());
URL keystore = ClassLoader.getSystemResource("server.keystore");
System.setProperty("Djavax.net.ssl.keyStore", keystore.toExternalForm());
System.setProperty("Djavax.net.ssl.keyStorePassword", "xy");
I already have done this with my policy file, but in case of the keys it seems it doesn't work. Have somebody got an idea?
Greetings
daniel

