Background :
I am trying to create an SSL context connection with an external vendor for handshake and then communicate using an xml over that connection.
clientCert = path["cert_path"]
clientKey = path["key_path"]
PROTOCOL = ssl.PROTOCOL_TLSv1
context = ssl.SSLContext(PROTOCOL)
context.load_default_certs()
context.load_cert_chain(clientCert, clientKey)
conn = httplib.HTTPSConnection(uri, 443, context=context)
conn.request("POST", '/', headers=headers, body=signedRequest) # code breaks here
response = conn.getresponse()
But this code breaks saying :
SSLError(1, u'[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:590)
Now, I know that the CA certificates are correctly placed on server, somewhere the path is getting messed up.
Question
How can i see what is the CA Path from which this ssl
and openssl
pick the CA Certs from.
Openssl seems to be making correct connection, so i need to provide the path to ssl explicitly here.
requests.utils
path can be found up as below, looking for something similar to understand for context.load_default_certs()
In [1]: from requests.utils import DEFAULT_CA_BUNDLE_PATH
In [2]: print(DEFAULT_CA_BUNDLE_PATH)
/usr/local/python/path/site-packages/certifi/cacert.pem