{"id":994,"hash":"c92cd82b707953efdeb5048b906ca525f186dadece0fd0d6c48e133825e6ed50","pattern":"Python Requests throwing &quot;SSLError&quot;","full_message":"I'm working on a simple script that involves CAS, Spring Framework security check, redirection, etc.  I would like to use Kenneth Reitz's Python Requests, because it's a great piece of work!\n\nHowever, CAS requires getting validated via SSL, so I have to get past that step first.  What does Python Requests want? Where is this SSL certificate supposed to reside?\n\nTraceback (most recent call last):\n  File \"./test.py\", line 24, in <module>\n  response = requests.get(url1, headers=headers)\n  File \"build/bdist.linux-x86_64/egg/requests/api.py\", line 52, in get\n  File \"build/bdist.linux-x86_64/egg/requests/api.py\", line 40, in request\n  File \"build/bdist.linux-x86_64/egg/requests/sessions.py\", line 209, in request\n  File \"build/bdist.linux-x86_64/egg/requests/models.py\", line 624, in send\n  File \"build/bdist.linux-x86_64/egg/requests/models.py\", line 300, in _build_response\n  File \"build/bdist.linux-x86_64/egg/requests/models.py\", line 611, in send\nrequests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed","ecosystem":"pypi","package_name":"ssl","package_version":null,"solution":"The problem you are having is caused by an untrusted SSL certificate.\n\nLike dirk mentioned in a previous comment, the quickest fix is setting verify=False:\n\nrequests.get('https://example.com', verify=False)\n\nPlease note that this will cause the certificate not to be verified. This will expose your application to security risks, such as man-in-the-middle attacks.\n\nOf course, apply judgment. As mentioned in the comments, this may be acceptable for quick/throwaway applications/scripts, but this should really not go to production software.\n\nIf just skipping the certificate check is not acceptable in your particular context, consider the following options, your best option is to set the verify parameter to a string that is the path of the .pem file of the certificate (which you should obtain by some sort of secure means).\n\nSo, as of version 2.0, the verify parameter accepts the following values, with their respective semantics:\n\nTrue: causes the certificate to validated against the library's own trusted certificate authorities (Note: you can see which root certificates (RCs) Requests uses via the Certifi library, a trust database of RCs extracted from Requests: Certifi - Trust Database for Humans).\n\nFalse: bypasses certificate validation completely.\n\nPath to a CA_BUNDLE file for Requests to use to validate the certificates.\n\nSource: Requests - SSL Cert Verification\n\nAlso take a look at the cert parameter on the same page.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/10667960/python-requests-throwing-sslerror","votes":553,"created_at":"2026-04-19T04:52:09.110134+00:00","updated_at":"2026-04-19T04:52:09.110134+00:00"}