fix SSL certificate handling