This article is from the Secure Sockets Layer Discussion List FAQ, by Shannon Appel SAppel@consensus.com with numerous contributions by others.
The short answer is that you insert SSL Plus between your I/O and
your application code.
Basically, you call SSL Plus instead of your read and write. SSL
Plus does its stuff and calls your callback code to do the I/O. Data
comes through your I/O routines, through SSL Plus, and then finally
to your application. SSL Plus only manages the data flowing through
the connection; it does not handle setting up and tearing down the
underlying network connection; your application should open the
network connection, then hand it off to SSL Plus for SSL handshaking
and data transfer. (This step is not shown in the diagram).
Normal:
-------------
| Application |
-------------
^
| I/O Calls
v
-------------
| WinSock |
-------------
^
| TCP Calls
v
-------------
| Internet |
-------------
-------------
| Application |
-------------
^
| SSL I/O Calls
v
------------- I/O Callbacks --------------------
| SSL Plus | <---------------->| Your Callback Code |
------------- --------------------
^
| I/O Calls
v
-------------
| WinSock |
-------------
^
| TCP Calls
v
-------------
| Internet |
-------------
 
Continue to: