Updated to accept self-signed certs.