Using huggingface CLI with a certificate

Hello, I am trying to download models through the Huggingface CLI from within a somewhat protected environment. In that environment, which I access through Citrix, I need to specify a certificate when I do python package installations via

pip install --cert mycert.pem themodule

When I go to use huggingface-cli login I am able to specify my token, and it appears that my token gets appropriately checked because my responses are different depending on whether I pass a valid token or not. However, rather than logging in, I get the following error:

requests.exceptions.SSLError: HTTPSConnectionPool(host=‘huggingface.co’, port=443): Max retries exceeded with url: /api/whoami-v2 (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)’)))

This appears to be related to the certificate issue, but I don’t know how to specify the certificate like I do for pip. Perhaps I need to ninja my way into some of the huggingface-cli code and specify my cert there?

Any help would be appreciated. Am currently at a loss for how I will pass models into this environment (I have some ideas, but they are definitely doing it the hard way).

1 Like

Wow…there are so many patterns of problems it’s going to be hard to isolate them.:sweat_smile:

I might not have read down far enough in that thread because I think my problem actually IS a proxy, though I’m not really sure. I didn’t see any option there that actually allowed you to specify a certificate, which seemed to be the issue with pip.

I’ll look into some of the options in that thread, though it would be ideal if there were simply a way to specify the certificate. To be clear, this is not really my area of expertise so there might be an easy answer and I just don’t see it.

Edit: Ah, I see that this thread includes many folks with proxy issues. ::sigh:: ok… hold my beer, I am going in…

1 Like

When a lot of people lament about some problem, there’s often something buggy in there…
Anyway, something is not working as it is supposed to.
I’ve never messed with SSL certificates…
Like this one?