added more support for ssl