views:

3776

answers:

6

Where can I download the JSSE and JCE source code for the latest release of Java? The source build available at https://jdk6.dev.java.net/ does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages.

Not being able to debug these classes makes solving SSL issues incredibly difficult.

Thanks.

+8  A: 

there: openjdk javax.net in the security group

src/share/classes/javax/net
src/share/classes/com/sun/net/ssl
src/share/classes/sun/security/ssl
src/share/classes/sun/net/www/protocol/https

also on this page:

src/share/classes/javax/crypto
src/share/classes/com/sun/crypto/provider
src/share/classes/sun/security/pkcs11
src/share/classes/sun/security/mscapi

These directories contain the core cryptography framework and three providers (SunJCE, SunPKCS11, SunMSCAPI). SunJCE contains Java implementations of many popular algorithms, and the latter two libraries allow calls made through the standard Java cryptography APIs to be routed into their respective native libraries.

PW
+1  A: 

Put Jad on your system path. Install JadClipse plugin for Eclipse. Use the force, read the decompiled source. :-)

Matej
Jad doesn't work well for class files newer than 1.4.
Thorbjørn Ravn Andersen
A: 

Hi PW,

Thanks for the link. I downloaded the OpenJDK6 source bundle (http://download.java.net/openjdk/jdk6/) but it seems the com.sun.net.internal.ssl package is empty. The classes that I would expect to be in that package are in sun.net.ssl.

While this helps with viewing the actual implementation, I can't use it in my debugger.

A: 

While this doesn't directly answer your question, using the javax.net.debug system property has helped me sort through SSL issues. -Djavax.net.debug=all pretty much gives you everything in gory detail. Documentation on this is at JSSE Debugging Utilities.

One note: I've seen that on Java 1.4 and maybe 1.5 levels, the output with option "all" is not as complete as it is using the same option on the Java 1.6 level. E.g., 1.6 shows the actual contents of network (socket) reads and writes. Maybe some levels of 1.4 and 1.5 do as well, but 1.6 was more consistent.

Chris Markle
A: 

I am also looking for the source of jsse.jar files of jre 6 distribution.

Is the SSLSocketImpl.java in sun.net.ssl same as the one in com.sun.net.ssl.internal.ssl under jsse.jar

Thanks, Sreedhar

A: 

Sorry in my previous post, I meant to say SSLSocketImpl in sun.security.ssl