How to add self-signed certificate to Java trust store on Windows

If Ubisecure SSO has been installed in an test environment using a self-signed certificate, it must be imported in to cacerts, the trusted issuer store:

Step-by-step guide

  1. Check %JRE_HOME% is defined
  2. Execute the following commands
cd C:\Program Files\Ubisecure\ubilogin-sso\ubilogin\custom\tomcat
"%JRE_HOME%/bin/keytool" -exportcert -keystore keystore.pfx -storetype PKCS12 -alias tomcat -file cert.crt
"%JRE_HOME%/bin/keytool" -import -alias tomcat -file cert.crt -keystore "%JRE_HOME%\lib\security\cacerts"