Can't use a crt certificate

Viewed 78

I'm trying to use a certificate without success. I'm using it like this:

r = requests.get('https://server:8443/teste', auth=HTTPBasicAuth('USER', 'PASSWORD'), verify='/home/path/certificate.crt')

and I got the error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='server', port=8443): Max retries exceeded with url: /teste (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

However I'm able to use the certificate with curl(if this help identifying the problem):

curl -s --cacert /home/path/certificate.crt -u USER:PASSWORD https://server:8443/teste

Can you help me make this work with the certificate?

0 Answers
Related