Added support for self-signed or invalid SSL certificates