added support for ssl