Chapter 7 Using SSL in ActiveX Clients


Implementing an SSL callback

When developing applications that interact with end users and support SSL, you should provide an SSL callback. The ORB invokes callback methods when required SSL settings have not been configured, or a setting has an incorrect value.

The callback can respond to exceptional conditions, such as server certificates that have expired. When using mutual authentication, the callback getCertificateLabel method allows you to present available certificates to the end user for them to choose. Lastly, the callback simplifies the handling of retry logic in the case where the user enters an invalid certificate password.

You can install a C++ callback or an ActiveX callback, but not both. C++ callbacks are discussed in "Creating CORBA C++ Clients" in the EAServer Programmer's Guide.

An ActiveX SSL callback must implement the methods in the CtsSecurity.SSLCallbackIntf interface. To install the callback, add a setting for the -ORBAXSSLCBComponent property in the ORB initialization string passed to the Orb.init method, as in the example below:

Dim orbOptions as String
orbOptions = "-ORBAXSSLCBComponent=mySSLCBProj.mySSLCBComponent,"
orbOptions = orbOptions & "-ORBqop=sybpks_intl"
Set orbRef = New JaguarTypeLibrary.ORB
orbRef.Init (orbOptions)

The SSLCallbackIntf methods are as follows:

Your implementation of the getPin, getCertificateLabel, and getCredentialAttribute method should allow the user to cancel the connection attempt. In response to a user cancel, raise an ActiveX error exception to abort the SSL session. In Visual Basic, you can do this by raising an error with vbObjectError as the error number. If you provide an error description, and error logging has been enabled with the -ORBlogFile Orb property, the error description is written to the log. After an SSL session is cancelled, the client program receives a connection-fail error as it would from any other failed connection attempt.

For more information about these callback methods, see the documentation for the CtsSecurity::SSLCallback interface in the generated Interface Repository documentation.

 


Copyright © 2002 Sybase, Inc. All rights reserved.