Retrieving session security information

The CtsSecurity.SSLSession and CtsSecurity.SSLSessionInfo classes allow you to determine whether SSL is used on connections from a proxy to the server, and if so, retrieve the SSL session settings. The code below illustrates the sequence of calls:

... code to set ORB ssl properties, create session,      instantiate proxy myComp ...
SSLSession sslSession =   SSLSessionHelper.narrow(myComp); 
try {
  SSLSessionInfo sslSessionInfo =     sslSession.getSessionInfo();
} catch (CtsSecurity.SSLNotEnabledError e) {
     ... this means the proxy does not use SSL ...
}

You can call SSLSessionHelper.narrow to obtain the session information associated with any CORBA object.

The SSLSessionInfo methods allow you to determine the SSL session properties, such as the server’s address, the client certificate in use, the server certificate in use, and so forth. For more information, see the Interface Repository documentation for the CtsSecurity::SSLSessionInfo interface. “Sample Java applications that use SSL” describes the SSL sample applications. These examples show how to retrieve and print the SSL session information.