JDK1.5 and JSSE provider question

Hi !

I'm trying to work with the IBM JSSE provider and the Sun JDK1.5 but it seems harder than expected. Of course I checked the policy and security files and it's ok to me, as well as the classpath.

I get an Exception and I don't understand why.

here is my code, and the runtime result :

import javax.net.ssl.TrustManager;

import javax.net.ssl.X509TrustManager;

import javax.net.ssl.SSLContext;

import javax.net.ssl.SSLSocketFactory;

import java.security.*;

import com.ibm.jsse.IBMJSSEProvider;

public class TestJCE {

public static void main(String[] args) {

TrustManager[] trustAllCerts = new TrustManager[]{

new X509TrustManager() {

public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){

return true;

}

public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){

return true;

}

public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){

return true;

}

public java.security.cert.X509Certificate[] getAcceptedIssuers() {

return null;

}

public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}

public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}

}

};

try {

System.out.println(System.getProperty("java.home"));

Provider pro = new com.ibm.jsse.IBMJSSEProvider();

System.out.println(pro.getName());

System.out.println(pro.getVersion());

System.out.println(pro.getInfo());

Security.addProvider(new com.ibm.jsse.IBMJSSEProvider());

SSLContext sc = SSLContext.getInstance("SSL", "IBMJSSE");

sc.init(null, trustAllCerts, new java.security.SecureRandom());

SSLSocketFactory factory = sc.getSocketFactory();

}

catch(java.security.NoSuchProviderException nspe) {

System.out.println(nspe);

}

catch(java.security.NoSuchAlgorithmException nsae) {

System.out.println(nsae);

}

catch(java.security.KeyManagementException kme) {

System.out.println(kme);

}

}

}

==========================

C:\Program Files\Java\jre1.5.0_03

IBMJSSE

1.42

IBM JSSE provider

export control - checking the cipher suites

export control - no cached value available...

export control - illegal CS SSL_DHE_DSS_WITH_RC4_128_SHA

export control - storing illegal entry into cache...

Exception in thread "main" java.lang.RuntimeException: Export restriction: SSLSo

cketFactory supports non-pluggable ciphersuite(s)

at com.sun.net.ssl.internal.ssl.ExportControl.checkCipherSuites(Unknown

Source)

at javax.net.ssl.SSLContext.getSocketFactory(Unknown Source)

at TestJCE.main(TestJCE.java:39)

could anyone help please ?

[2923 byte] By [elysianfra] at [2007-10-1 16:21:24]
# 1

If you look at the JSSE source code via the SCSL program or similar, you'll see

that JSSE allows for pluggability as long as the list of supported ciphersuites

is completely contained in the list of "approved" ciphersuites. (ExportControl.java)

SSL_DHE_DSS_WITH_RC4_128_SHA is not one of those listed, but it probably

should be. Anyway, that's why it's failing.

wetmorea at 2007-7-11 0:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

you are right :

http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#PLUG

-is there any solution to override this ?

-otherwise I should use IBM JDK with their IBMJSSE ? What a pity

-is there any provider implementing SSLv2 and only the "approved" ciphers ? I'm going to look for one.

elysianfra at 2007-7-11 0:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3

Is the reason you want to use IBMJSSE in Sun's JDK because it supports SSLv2 and

Sun's JDK doesn't? You should think carefully about this, the SSLv2 protcol

has flaws in a number of places, and is generally accepted as not

being secure enough. All modern browsers should support SSv3.

If you'd like specifics, I'd suggest Eric Rescorla's book "SSL and TLS-Designing

and Building Secure Systems."

> -is there any solution to override this ?

Nothing that I'm aware of that is allowed by the licensing terms.

wetmorea at 2007-7-11 0:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 4

thanks again :) I will try to find that book.

>Is the reason you want to use IBMJSSE in Sun's JDK because it supports SSLv2 and Sun's JDK doesn't?

Yes. I'm building a tool for testing web servers behaviors, under the different possibilities of SSLv2, v3 and TLS, and of course the different ciphers. I could use OpenSSL, but I'm stubborn and I want a nice full-java program..

elysianfra at 2007-7-11 0:34:06 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...