1

I’m running python3.6.8 in ubuntu 14.04.6

pip continually fails to retrieve packages due to SSL certificate errors, despite use of options to skip SSL checking. I’ve looked at many posts on stack exchange and elsewhere but none of the proposed solutions have worked for me so far.

/etc/pip.conf looks like this:

[global]
index-url = https://pypi.org/simple
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org

http.sslVerify = false
 
log = /var/log/pip/pip-new.log

But when I try to install with pip:

$ python3 -m pip install colored
Collecting colored
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)': /simple/colored/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)': /simple/colored/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)': /simple/colored/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)': /simple/colored/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)': /simple/colored/
  Could not fetch URL https://pypi.org/simple/colored/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/colored/ (Caused by SSLError(SSLError(1, '[SSL] EC lib (_ssl.c:852)'),)) - skipping

Why does pip encounter these SSL errors, despite options to skip SSL check?

Thanks!

Tomasso
  • 693
  • 2
  • 9
  • 17
  • 1
    Did you try opening the actual link in a browser? Your administrator might have blocked SSL communication for whatever security reasons. – MedoAlmasry Feb 16 '22 at 18:09
  • This is a "headless" system without a browser. And in any case, why does pip try SSL communication - I specified trusted-host and http.sslVerify = false? – Tomasso Feb 16 '22 at 18:16
  • 1
    *"'[SSL] EC lib (_ssl.c:852)'),"* - this is not an SSL certificate verification problem and therefore it does not help to skip SSL certificate verification. – Steffen Ullrich Feb 16 '22 at 18:19
  • Ah - What causes this error? – Tomasso Feb 16 '22 at 18:26
  • 1
    Try wget https://pypi.org/simple/colored/: just to make sure that works. – MedoAlmasry Feb 16 '22 at 20:55
  • $ wget pypi.org/simple/colored --2022-02-17 16:57:12-- http://pypi.org/simple/colored Resolving pypi.org (pypi.org)... 151.101.0.223, 151.101.192.223, 151.101.128.223, ... Connecting to pypi.org (pypi.org)|151.101.0.223|:80... connected. HTTP request sent, awaiting response... 403 SSL is required 2022-02-17 16:57:14 ERROR 403: SSL is required. – Tomasso Feb 17 '22 at 16:58
  • This probably means your headless system is NOT capable of accessing any https links. I would try to figure out a way to make sure wget works for https. – MedoAlmasry Feb 18 '22 at 14:03
  • @MedoAlmasry I have a similar issue to Tomasso. Yes, I CAN access all 3 links above in a browser (e.g. pypi.python.org) but still cannot upgrade or install any packages including pip. Does that mean the administrator is still allowing SSL communication for me? – PowerUser Apr 15 '23 at 22:01
  • @PowerUser There are several reasons that might be triggering this error. First off, are you using a VM? If so, is the time and date correctly set? Additionally, if you can access the packages from the browser, can you do the same using wget from the terminal? – MedoAlmasry Apr 19 '23 at 21:23
  • @MedoAlmasry, I appreciate your help. It turned out to be a corporate security issue and so there was nothing I could do on my own. – PowerUser May 23 '23 at 21:56

0 Answers0