30

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.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

6 Answers6

13

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.
  • 3,727
  • 32
  • 35
  • You said "this page" - could you include a link? – hawkeye Sep 13 '11 at 04:41
  • this contains e.g. sun/security/ssl/SSLSocketImpl.java but not com/sun/net/ssl/internal/ssl/SSLSocketImpl.java. i can't seem to find source for the latter which the original poster was after (and ssl issues are driving me mad too!) – Partly Cloudy Oct 15 '12 at 15:37
  • 1
    The link goes to a documentation page with no obvious links to download the source (apart from the link to download the entire OpenJDK source). – David Moles Apr 01 '13 at 23:51
  • @PW. Hi, I am linking the jce.jar source with openjdk-source/jdk/src/share/classes folder but Eclipse doesn't seem to pick it up. Could you suggest what is going on wrong? – Eugen Apr 04 '13 at 12:39
  • This [question](http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar/2174607#) partially solved my problem. Now it tells me that jce.jar is compiled without line number information so I can't set breakpoints inside source files... – Eugen Apr 04 '13 at 13:24
4

I downloaded the src jar from: http://download.java.net/jdk6/source/

NOTE: This is a self extracting jar, so just linking to it won't work.

... and jar -xvf <filename> won't work either.

You need to: java -jar <filename>

cheers, jer

jer
  • 1
  • 1
2

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
  • 2,076
  • 4
  • 25
  • 46
2

if you just want read the source code:

http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/security/ssl/SSLSocketImpl.java

Thijs
  • 283
  • 2
  • 5
leef
  • 593
  • 8
  • 12
1

For some unknown reason Orcale doesn't released source.jar and javadocs jar for JSE. I found only one place where you can find them http://jdk7src.sourceforge.net/ but it's outdated and unofficial. The only one way is to clone OpenJDK repository

Sergey Ponomarev
  • 2,947
  • 1
  • 33
  • 43
0

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

Matej
  • 6,004
  • 2
  • 28
  • 27