Copy SSL certificate verification from pip.