vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

CERTIFICATE_VERIFY_FAILED if cert verification is used together with proxy

Open sliwinski-milosz opened this issue 4 years ago • 1 comments

Hi Guys,

I am trying to record a call with the latest vcr:

proxies = {
    'http': 'socks5h://user:password@host:port'
    'https': 'socks5h://user:password@host:port'
}
requests.get(some_url, cert=('client.crt', 'client.key'), verify='ca_root.crt', proxies=proxies)

But it fails with:

requests.exceptions.SSLError: SOCKSHTTPSConnectionPool(host='hidden.com', port=443): Max retries exceeded with url: /hidden/hidden (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

I also tried to set verify=False but it didn't help.

I tested that on vcrpy 4.0.2 and also on latest master f387950486caaf4fcf60de79aa24c8870460e9ca.

Is that a known issue? I have seen that tests for proxy has been added lately - however it seems that the case when using cert has not been tested.

When I am running the code without recording vcr then it works just fine.

sliwinski-milosz avatar Jul 29 '20 11:07 sliwinski-milosz

This definitely relates to #548 but is not really related to the client cert verfication, because it also yields the same error when there is no client-cert provided.

elbart avatar Jul 29 '20 12:07 elbart