Added support for ssl connections