Added code to handle trusting self-signed SSL certificate