2captcha / 2captcha-python

Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
https://2captcha.com
MIT License
495 stars 93 forks source link

CERTIFICATE_VERIFY_FAILED #55

Closed baongoc159 closed 1 year ago

baongoc159 commented 1 year ago

Hi team, what causing this error: HTTPSConnectionPool(host='2captcha.com', port=443): Max retries exceeded with url: /in.php (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) I could run the code in different computer and get result. But change to this new computer, using window subsystem on linux. I meet this Thanks

kratzky commented 1 year ago

I guess the current date on your WSL is before October 2022 and due to that the certificate is not valid for your WSL.

Just sync the time with NTP:

sudo ntpdate pool.ntp.org
baongoc159 commented 1 year ago
sudo ntpdate

Thank for your comment. But the error is still there after doing sudo ntpdate

kratzky commented 1 year ago

But what's your current date on the WSL?

kratzky commented 1 year ago

And also try to install pip_system_certs

baongoc159 commented 1 year ago

The date seems correct (.venv) n:~/votWeb$ date Fri Jun 9 16:44:45 +07 2023 (.venv) n:~/votWeb$ sudo ntpdate pool.ntp.org 9 Jun 16:45:17 ntpdate[19467]: adjust time server 103.130.217.41 offset -0.037110 sec

pip_system_certs is install but the error still the same.

kratzky commented 1 year ago

Sorry, but I have no more suggestions for your case. Can only recommend to search for wsl python CERTIFICATE_VERIFY_FAILED and try the suggestions.