SourcePro : Secure Communication Module User’s Guide : PART II Secure Sockets Package : Using Secure Sockets : Developing Secure Applications : Porting Existing Networking Package Applications to the Secure Sockets Package
Porting Existing Networking Package Applications to the Secure Sockets Package
NOTE: SSL/TLS is defined to work only over TCP/IP sockets. UDP sockets cannot be used with SSL/TLS.
To port existing Networking package applications to the Secure Sockets package, follow these steps:
1. Obtain certificates and keys for your application. See Obtaining Certificates.
2. Initialize the Secure Sockets package and seed the random number generator (if necessary). See Initializing the Secure Sockets Package.
3. Create an RWSecureSocketContext. See Creating the Secure Socket Context. Initialize the context using the setIdentity() function for a server, or the prepareToAuthenticate() function for a client.
To use both client and server authentication, call both functions. See Initializing the Context to Perform Both Client and Server Authentication.
4. Construct a certificate, if you are writing a server application. See Constructing a Certificate and Checking the Validity of a Certificate.
5. Modify class names:
*RWSocketPortal to RWSecureSocketPortal
*RWSocketListener to RWSecureSocketListener
NOTE: Some RWSocket methods are not supported by RWSecureSocket.
6. Associate the RWSecureSocketContext with a socket, a portal, or a listener. Use either the constructor, the connect() method, the bind() method, the accept() method, or the setContext() method.