Tags: appreciated, asolution, ibm, javasecuritynosu, nothingthat, searched, simular, situations, software, ssl, sslcontext, sslcontextgetinstance, throwing, websphere

SSLContext sc = SSLContext.getInstance("SSL") throwing an java.security.NoSu

On Software » IBM/Websphere

4,063 words with 1 Comments; publish: Sat, 17 May 2008 16:33:00 GMT; (400218.75, « »)

Any help here would be appreciated. I have searched all over for a

solution to this problem and have found simular situations but nothing

that helped me so far. I am trying to connect via SSL using WSAD 4.0

and JDK 1.3.1. The following code works when I run it as a stand

alone application using the jsse.jar, jnet.jar, jcert.jar. However

when I try to run this through the websphere appserver I get the

following stack trace

java.security.NoSuchAlgorithmException: Class com.ibm.jsse.w

configured for SSLContext not a SSLContext

at java.lang.Throwable.<init>(Throwable.java:54)

at java.lang.Throwable.<init>(Throwable.java:68)

at com.sun.net.ssl.SunJSSE_b.a(DashoA6275)

at com.sun.net.ssl.SSLContext.getInstance(DashoA6275)

Here is a code snippet for what I am doing.

static

{

System.setProperty("java.protocol.handler.pkgs",

"com.sun.net.ssl.internal.www.protocol");

Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

System.setProperty("javax.net.debug",

"ssl,handshake,data,trustmanager");

}

...

...

//use our own trust manager so we can always trust

//the URL entered in the configuration.

X509TrustManager tm = new MyX509TrustManager();

KeyManager []km = null;

TrustManager []tma = {tm};

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

sc.init(km,tma,new java.security.SecureRandom());

SSLSocketFactory sf1 = sc.getSocketFactory();

HttpsURLConnection.setDefaultSSLSocketFactory(sf1);

From java.security...

#

# List of providers and their preference orders (see above):

#

security.provider.1=sun.security.provider.Sun

security.provider.2=com.ibm.crypto.provider.IBMJCA

Once again any help would be appreciated.

Steve

All Comments

Leave a comment...

  • 1 Comments
    • steve,

      did able to fix it?I am experiencing the similar error.Apperciated if you ca

      n post back the solution,if you fixed it.

      thanks

      Senthil

      quote:
      === Original Words ===

      Steve

      Any help here would be appreciated. I have searched all over for a

      solution to this problem and have found simular situations but nothing

      that helped me so far. I am trying to connect via SSL using WSAD 4.0

      and JDK 1.3.1. The following code works when I run it as a stand

      alone application using the jsse.jar, jnet.jar, jcert.jar. However

      when I try to run this through the websphere appserver I get the

      following stack trace

      java.security.NoSuchAlgorithmException: Class com.ibm.jsse.w

      configured for SSLContext not a SSLContext

      at java.lang.Throwable.<init>(Throwable.java:54)

      at java.lang.Throwable.<init>(Throwable.java:68)

      at com.sun.net.ssl.SunJSSE_b.a(DashoA6275)

      at com.sun.net.ssl.SSLContext.getInstance(DashoA6275)

      Here is a code snippet for what I am doing.

      static

      {

      System.setProperty("java.protocol.handler.pkgs",

      "com.sun.net.ssl.internal.www.protocol");

      Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

      System.setProperty("javax.net.debug",

      "ssl,handshake,data,trustmanager");

      }

      ...

      ...

      //use our own trust manager so we can always trust

      //the URL entered in the configuration.

      X509TrustManager tm = new MyX509TrustManager();

      KeyManager []km = null;

      TrustManager []tma = {tm};

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

      sc.init(km,tma,new java.security.SecureRandom());

      SSLSocketFactory sf1 = sc.getSocketFactory();

      HttpsURLConnection.setDefaultSSLSocketFactory(sf1);

      From java.security...

      #

      # List of providers and their preference orders (see above):

      #

      security.provider.1=sun.security.provider.Sun

      security.provider.2=com.ibm.crypto.provider.IBMJCA

      Once again any help would be appreciated.

      Steve


      #1; Sat, 17 May 2008 16:34:00 GMT