Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Algorithm SunX509 not available

843811Dec 11 2001 — edited Dec 18 2001
I 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());
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2002
Added on Dec 11 2001
2 comments
1,087 views