Added optional support for SSL