Self Signed SSL Certs without a keystore
I am trying to do the following and get the exception below.
privatestaticvoid loginToF5() {
Security.addProvider(new XTrustProvider());
XTrustProvider.install();
if (getJVMVendor().startsWith("IBM")) {
"ssl.ServerSocketFactory.provider"Security.setProperty(, "org.apache.axis.components.net.IBMFakeTrustSocketFactory");
}
boolean login = interfaces.initialize(hostname, username, password);
if (!login) {
System.out.println("Unable to login to f5, " + hostname + ", with supplied username and password");
System.exit(-1);
}
}
Caused by: java.lang.Exception: Truststore file does not exist: /root/.keystore
at com.ibm.jsse2.uc.a(uc.java:91)
at com.ibm.jsse2.lc.f(lc.java:12)
at com.ibm.jsse2.lc.(lc.java:16)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1345)
at java.security.Provider$Service.newInstance(Provider.java:880)
I can get around that issue with adding the following, but I get the following exception, any thoughts or ideas?
System.setProperty(
"org.apache.axis.components.net.SecureSocketFactory",
"org.apache.axis.components.net.IBMFakeTrustSocketFactory");
Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.net.ssl.SSLContext
at org.apache.axis.components.net.IBMFakeTrustSocketFactory.getContext(IBMFakeTrustSocketFactory.java:55)
In doing some research it looks like that class was renamed to javax.net.ssl.SSLContext.
Do I need to rebuild something to get this to work?