how to use cert in authentication with https server

Viewed 17

the server provider provided to me a cert file in pro format without key in order to use it in the communication between my client app (in python) and the server.

The pem file (cert without key):

-----BEGIN CERTIFICATE-----

MIIFSDCCBDCg........................................

-----END CERTIFICATE-----

I tried to use the following solution but it returns errors

r = requests.post(url, data=payload, headers=headers, cert=('cert.pem'))

I got the following error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='sauth-external.apple.com', port=443): Max retries exceeded with url: /api/v1.0/external/authEntityRequests (Caused by SSLError(SSLError(9, '[SSL] PEM lib (_ssl.c:4029)')))

Also I tried to use the following solution but it returns 401

r = requests.post(url, data=payload, headers=headers, verify='cert.pem')

I got 401 error code

Am I missing thing? what is the solution to make the connection with the server and to authenticate with the server?

0 Answers
Related