The following curl cmd works as is, without any issues,
curl -H "Authorization: Bearer $AUTH" --cacert "/var/lib/myapp/server-ca.crt" https://myapp.common:2567/service -X GET
Implementing this in python,
headers = {"Authorization": "Bearer {}".format(os.getenv("AUTH"))}
cacert = "/var/lib/myapp/server-ca.crt"
url = "https://myapp.common:2567/service"
response = requests.get(url=url, headers=headers, verify=cacert)
However it fails with the following error
HTTPSConnectionPool(host='myapp.common', port=2567): Max retries exceeded with url: /service
(Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
For context the cacert here has the following info:
---BEGIN CERTIFCATE---- SOMERANDOMSTRING ---END CERTIFICATE----