How to implement guide with ssl certificate verification when using requests in python 2.7
Could someone explain I'm getting frustrated with I've searched everywhere and can't find a clear answer... Hey everyone, I'm running into an issue that's driving me crazy. I'm trying to make an HTTPS request using the `requests` library in Python 2.7, but I'm running into an SSL certificate verification scenario. When I attempt to access a secure endpoint, I receive the following behavior: ``` requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) ``` I've verified that the URL is correct and the server's certificate is valid. I've also confirmed that my version of `requests` is up to date (`2.22.0`), and I'm using `Python 2.7.18`. Hereβs the code Iβm using to make the request: ```python import requests url = 'https://example.com/api/data' response = requests.get(url) print(response.json()) ``` To troubleshoot this, I tried disabling SSL verification by adding `verify=False` to the request, like this: ```python response = requests.get(url, verify=False) ``` While this bypasses the behavior, it feels like a security risk, and I would prefer to handle SSL verification properly. I checked if I have the `certifi` package installed, and it is present (`2019.9.11`). I suspect that the root certificates might not be updated. Can anyone guide me on how to resolve this scenario without compromising SSL verification? Are there specific certificates I need to include or update? Any help would be greatly appreciated! Any ideas what could be causing this? I'm using Python 3.11 in this project. Any help would be greatly appreciated! Any feedback is welcome!