I managed to do this by setting the _JAVA_OPTIONS environment variable with all the additional system properties to go through; as a Windows batch file, it looks like this:
setlocal set _JAVA_OPTIONS=%_JAVA_OPTIONS% -Djavax.net.ssl.trustStore="%JAVA_HOME%\jre\lib\security\cacerts" -Djavax.net.ssl.keyStoreType=PKCS12 -Djavax.net.ssl.keyStorePassword={...passwordForThePFX...} -Djavax.net.ssl.keyStore=r:\cert.pfx wsimport -s . -verbose https:
For common sense, Java options in the long string "set":
-Djavax.net.ssl.trustStore="%JAVA_HOME%\jre\lib\security\cacerts" -Djavax.net.ssl.keyStoreType=PKCS12 -Djavax.net.ssl.keyStorePassword={...passwordForThePFX...} -Djavax.net.ssl.keyStore=R:\cert.pfx
You may or may not need to configure trustStore ; I should have, since I have several installations, and Java is collecting the wrong cacerts file for me.
Similarly, you will not need keyStorePassword if the keystore is not password protected. As for keyStoreType , you need to specify this if you are not accessing the Java keystore.
Ultimately, the only "required" option is keyStore , which determines where the client certificate and keys live (and it is only required if the client certificate is not located in any of the main Java certificate stores). As shown above, the above example refers to a client certificate in a PFX file generated by exporting it from a Windows certificate store.
Chris j
source share