Algorithm SunX509 not available
843811Dec 11 2001 — edited Dec 18 2001I am trying to get a client application to talk to a servlet on Tomcat using SSL. SSL works fine on Tomcat with the browser. However, I get the following error when I run my client program:
No such algorithmException: Algorithm SunX509 not available.
My code looks like this:
KeyStore ks = KeyStore.getInstance("JKS");
ClassLoader cl = this.getClass().getClassLoader();
InputStream keyStore = cl.getResourceAsStream("/.keystore");
ks.load( (InputStream)keyStore, pword);
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
tmf.init(ks);
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, tmf.getTrustManagers(), null);
com.sun.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());