Sun JSSE for SSL connection to Domino Server

Sun JSSE for SSL connection to Domino Server

Post by Je VUIBER » Sat, 11 Sep 2004 18:42:38


i.

A servlet on WebSphere Application Server has to connect a domino server
(R5) in SSL mode.

All servlets are "compiled" using Sun JDK 1.4.2.

But it seems that there is a problem during the handshake.

We tried the same program but compiled with the IBM JDK and it works.

Can someone tell me why ?

Sincerely.

Jerome

PS : Here is the sample code we use to test the connection.

import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import java.security.KeyStore;
import java.security.Security;
import java.security.cert.*;
import java.util.Properties;

public class Connexion_ibmJDK_SSLSocket
{
public static void main(String args[])
{
String host= "test.dev.fr";
int port= 443;
String path= "/dominobasepath.NSF";

String keyStore= "BureauIntranetKeys.jks";
String key= "bureauintranet";
String pwd= "2003bureau";

com.ibm.net.ssl.SSLContext ctx= null;
File keyStoreFile= null;
KeyStore ks= null;
com.ibm.net.ssl.KeyManagerFactory kmf= null;
com.ibm.net.ssl.TrustManagerFactory tmf= null;
SSLSocketFactory factory= null;
SSLSocket socket= null;
BufferedReader reader= null;
BufferedWriter writer= null;
Properties properties= null;
String handlers= null;
String line= null;

try
{
// Propri JAVA relatives la surit-------------------------
//Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
Security.addProvider(new com.ibm.jsse.IBMJSSEProvider());
properties= System.getProperties();
properties.put("javax.net.debug", "all");
properties.put("javax.security.debug", "all");
handlers= System.getProperty("java.protocol.handler.pkgs");
if (handlers == null)
{
properties.put( "java.protocol.handler.pkgs"
, "com.ibm.net.ssl.internal.www.protocol" );
}
else
{
properties.put( "java.protocol.handler.pkgs"
,
"com.ibm.net.ssl.internal.www.protocol|".concat(handlers) );
}

// Magasin contenant les autorit de certification ----------------
properties.put("javax.net.ssl.trustStore", "BureauIntranetCACerts.jks");
properties.put("javax.net.ssl.trustStorePassword", "2003bureau");

System.setProperties(properties);

// Initialisation du contexte SSL avec le certificat client et le --
// protocole (valeurs possibles : SSL, SSLv2, SSLv3, TLS,
TLSv1) ---import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import java.security.KeyStore;
import java.security.Security;
import java.security.cert.*;
import java.util.Properties;

public class Connexion_ibmJDK_SSLSocket
{
public static void main(String args[])
{
// String host= "annuaire.eurocis.fr";
String host= "sdev-test.dev.eurocis.fr";
int port= 443;
// String path= "/";
// String path= "/names.nsf";
String path= "/opus/OPUSRECHERCHE.NSF";

String keyStore= "BureauIntranetKeys.jks";
String key= "bureauintranet";
String pwd= "2003bureau";

com.ibm.net.ssl.SSLContext ctx= null;
File keyS