Please note that I am not trying to set up my weblogic server to
support SSL, or anything like that. I simply wish to have the ability
to access https (secure) sites using the java URL and related objects
in some of my Java classes. These Java classes are not EJBs.
I'm working in Visual Age using the WebLogic Integration Kit. I've got
a simple class that succesfully accomplishes what I described above.
Following are the relevant lines of code, which establish that JSSE is
available for use, followed by a call to the URL:
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());
("com.sun.net.ssl.internal.ssl.Provider").newInstance();
URL url2 = new URL("https://www.somesecuresite.com");
// get a url connection object
URLConnection uconn2 = url2.openConnection();
BufferedReader in = new BufferedReader(new
InputStreamReader(uconn2.getInputStream()));
Calls to this code work fine, over and over throughout my code, until
I make a JNDI call to obtain a database connection from the WebLogic
server, like InitialContext icontext = new InitialContext(env). The
InitialContext call also works fine as it always has. However,
immediately following this code, any calls to the https-calling code
above yields the following error:
java.io.IOException: Certificate not valid:
fingerprint = 115632b0c42739458d5cf441895f1c72, not before = Wed Nov
09 18:54:17 EST 1994, not after = Fri Dec 31 18:54:17 EST 1999, holder
= C=US O=RSA Data Security, Inc. OU=Secure Server Certification
Authority , issuer = C=US O=RSA Data Security, Inc. OU=Secure Server
Certification Authority , key = modulus length=126 exponent length=3
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.io.IOException(java.lang.String)
void weblogic.security.SSL.SSLCertificate.verify()
void weblogic.security.SSL.SSLCertificate.input(java.io.InputStream)
void weblogic.security.SSL.Handshake.input(java.io.InputStream)
weblogic.security.SSL.Handshake
weblogic.security.SSL.SSLSocket.getHandshake()
void weblogic.security.SSL.SSLSocket.clientInit()
void weblogic.security.SSL.SSLSocket.initialize(java.net.Socket,
boolean, weblogic.security.SSL.SSLParams)
weblogic.security.SSL.SSLSocket(java.net.InetAddress, int,
weblogic.security.SSL.SSLParams)
void weblogic.net.http.HttpsClient.openServer(java.lang.String, int)
void weblogic.net.http.HttpsClient.openServer()
weblogic.net.http.HttpClient(java.net.URL)
weblogic.net.http.HttpsClient(java.net.URL)
weblogic.net.http.HttpClient
weblogic.net.http.HttpClient.New(java.net.URL)
void weblogic.net.http.HttpURLConnection.connect()
java.io.InputStream weblogic.net.http.HttpURLConnection.getInputStream()
...followed by my own method call.
Why, all of a sudden does the code decide to try to use
weblogic.net.http classes? I know my certificate for WebLogic is
invalid, but who cares? I'm not trying to use weblogic.net.http
anything -- I'm trying to use JSSE. And it works fine until I make an
InitialContext call, at which time something seems to get confused.
I would greatly appreciate any assistance you might lend on this
subject. I've tried disabling SSL in weblogic by setting
weblogic.security.ssl.enable = false and
weblogic.security.SSLHandler.enable = false, but to no avail.
Thanks in advance,
Ed
Why not try to install your protocol handler again, immediatly
after calling in to jndi to get an initial context ?
Providing your not using tunnelled RMI it shouldn't make
much of a difference.
-- Rory Chisholm
>....followed by my own method call.
thanks in advance,
Natxo
>....followed by my own method call.