Requests SSL certificate verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
Python module requests rarely meet SSL certifiacte errors such as requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852).These errors may occurs beacause of target sites’ or your computer’s improper configuration of SSL certificate. To aviod this error, the best solution is reconfigure the certificate of your device. But if you can not ensure the reason that causes this error, you can simply turn off the SSL validation process of requests by follwing code
import requestsurl = "https://www.japonx.net"
response = requests.get(url, verify=False)
But meanwhile, there is also a annoying warning message InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised every time when requests send out a connection request. To disable this warning, furtherly input this piece of code to instead of the above code.
from requests.packages.urllib3.exceptions import InsecureRequestWarningrequests.packages.urllib3.disable_warnings(InsecureRequestWarning)url = "https://www.japonx.net"
response = requests.get(url, verify=False)