WebLogic Server 6.1 Code Examples, BEA Systems, Inc.

examples.security.sslclient
Class SSLClient

java.lang.Object
  |
  +--examples.security.sslclient.SSLClient

public class SSLClient
extends java.lang.Object

SSLClient is a short example of how to use the SSL library of WebLogic to make outgoing SSL connections. It shows both how to do this from a stand-alone application as well as from within WebLogic (in a Servlet). To run this application client example: - WebLogic is started and listening on both SSL and non-SSL ports (80 and 443 used in the example batch scripts) - WebLogic has SnoopServlet.jsp in it's jsp examples (samples/examples/jsp), place it in the base directory of the default web application (config/examples/DefaultWebApp_examplesServer/public_html) with no access control protection. - Classpath must contain examples.security.sslclient package as well as the myserver\clientclasses directory - WebLogic SSL HostnameVerifier must be set to this example's NulledHostnameVerifier: -Dweblogic.security.SSL.hostnameVerifier=examples.security.sslclient.NulledHostnameVerifier - If using the JSSE implementation from JavaSoft: - Classpath must contain jsse.jar, jcert.jar, and jnet.jar - Must use jdk1.3 - Must uncomment three places in this code and re-compile: 1. JSSE import statement 2. method jsseURLConnect 3. NullHostnameVerifier inner class - wlsWls.bat will call the WebLogic Server using WebLogic SSL client classes. - jsseWls.bat will call the WebLogic Server using WebLogic SSL client classes. To run this example from a servlet: - All above requirements need to be met, as this servlet just calls out to the original application. - Register examples.security.sslclient.SSLClientServlet in a web application, in the WebLogic Server. - Point your browser to the WebLogic Server: http://localhost:80/sslClient - To see JSSE client classes used in the servler, you must restart the WebLogic server with it's SSL disabled using the console SSL panel. Be careful to notice that the WebLogic server, when making an outgoing SSL connection will use that instance of the server's certificate. When communicating to either the same or another WebLogic server with two-way SSL, the originating server's certificate will be verified against the client root CA list in the receiving WebLogic server.

Author:
Copyright (c) 1999-2001 by BEA Systems, Inc. All Rights Reserved.
See Also:
SSLClientServlet

Constructor Summary
SSLClient()
           
 
Method Summary
static void jsseURLConnect(java.lang.String host, java.lang.String port, java.lang.String sport, java.lang.String query, java.io.OutputStream out)
          This method contains an example of how to use the URL and URLConnection objects to create a new SSL connection, using JSSE SSL client classes.
static void main(java.lang.String[] argv)
           
 void SSLClient()
           
static void wlsURLConnect(java.lang.String host, java.lang.String port, java.lang.String sport, java.lang.String query, java.io.OutputStream out)
          This method contains an example of how to use the URL and URLConnection objects to create a new SSL connection, using WebLogic SSL client classes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLClient

public SSLClient()
Method Detail

jsseURLConnect

public static void jsseURLConnect(java.lang.String host,
                                  java.lang.String port,
                                  java.lang.String sport,
                                  java.lang.String query,
                                  java.io.OutputStream out)
This method contains an example of how to use the URL and URLConnection objects to create a new SSL connection, using JSSE SSL client classes. This method is commented out for compilation without the JSSE classes. To observe JSSE in action, see intructions at the top.

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException

SSLClient

public void SSLClient()

wlsURLConnect

public static void wlsURLConnect(java.lang.String host,
                                 java.lang.String port,
                                 java.lang.String sport,
                                 java.lang.String query,
                                 java.io.OutputStream out)
This method contains an example of how to use the URL and URLConnection objects to create a new SSL connection, using WebLogic SSL client classes.

Documentation is available at
http://e-docs.bea.com/wls/docs61

Copyright © 2001 BEA Systems, Inc. All Rights Reserved.