Fixed crash when SSL certificate is not valid.