python

How can I solve CondaHTTPError in anaconda?


I'm using Windows 10 pro(x64) and I have just installed Anaonda 4.3.1

But whenever I try to install a package or update conda, it shows an error like the below.

(d:\Miniconda3) C:\Windows\system32>conda update conda
Fetching package metadata .....

CondaHTTPError: HTTP None None for url <None>
Elapsed: None

An HTTP error occurred when trying to retrieve this URL.
SSLError(SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert bad record mac')],)",),),)

conda config --set ssl_verify False doesn't make any difference either.

I have no problem installing packages using pip.


Solution

  • These errors coming from such abstracting (i.e. with a high level of abstraction) tools are usually really hard to debug from the tool themselves (it requires quite a lot of digging around in the tool's code to pinpoint and finally find the issue); to the extent that in the vast majority of cases, once you've debugged it, you know enough about the tool in question to actually be able to write a patch to solve that problem.

    What I would recommend is to first trace how does conda get the metadata it is getting at first (first line of your output). On UNIX I would recommend tcpdump, but on windows I would use wireshark (albeit according to the wikipedia page for tcpdump, it works on windows too).

    Once you know what host the package should be obtained from, you can try to understand why it occurs. Namely, the bad record mac error should not occur under normal conditions; i.e. either you have a network problem (try with another network) or there is a server (more likely if conda used to work) or client problem.

    To try to debug the SSL issue once you know the host, run:

    openssl s_client -connect $host:443 -msg -debug
    

    Where $host is the host you found using tcpdump/wireshark.

    Note: I have not linked wireshark.org in this answer, but instead the wikipedia page for wireshark to prevent supporting bogus security practices 1,2.