Some details are left out for the sake of simplicity. SSL works similarly to this for a client-server situation:
Block Diagram of How SSL Works |