World's most popular travel blog for travel bloggers.

What are the different components to be used while writing SSL client application ? Discuss. Write sample codes for SSL client and SSL Client Servelet and explain it.

, , No Comments

SSL Client Application Components 

At a minimum, an SSL client application comprises the following components: 

Java client 

A Java client performs these functions:

  • Initialises an SSLContextwith client identity, a HostnameVerifierJSSE, a TrustManagerJSSE, and a HandshakeCompletedListener. 
  • Creates a keystore and retrieves the private key and certificate chain. 
  • Uses an SSLSocketFactory, and 
  • Uses HTTPS connect to a JSP served by an instance of WebLogic


The HostnameVerifier implements the interface. It provides a callback mechanism so that implementers of this interface can supply a policy for handling the case where the host that is being connected the server name from the c(SubjectDN) must match. 


The HandshakeCompletedListener implements the It defines how the SSL client receives notifications about the completion of an SSL handshake on a given SSL connection. It also defines the number od times an SSL handshake takes place on a given SSL connection. 


The TrustManager implements the interface. it builts a certificate path to a trusted root and returns true if it can be validated and is trusted for client SSL authentication.

build script (build.xml)

This script compiles all the files required for the application and deploys them to the WebLogic Server applications directories.

Sample package code for this type program


import java.util.Hashtable;
import javax.naming.NamingException;
import javax.naming.Context;
import javax.naming.InitialContext
import javax.servlet.ServletOutputStream;
import weblogic.jndi.Environment;
/** SSLClient is a short example of how to use the SSL library o
* WebLogic to make outgoi
* d
* WebLogic (in a Servlet).

>> See complete program in STUDY MATERIAL MCS051 Block 3 Page 37


Post a Comment

Let us know your responses and feedback