Added support for SSL in the NetworkStreamFactory.
Fixes #3