I want to send XML
to the soap request I use python request like below:
response = requests.post(url, data=body, headers=headers)
when I send the request I give this request:
requests.exceptions.SSLError: HTTPSConnectionPool(host='49.1.92.38', port=7911): Max retries exceeded with url: /ECARE/CRMInterface_INV_Services (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
I make verify=False
in a request like this:
response = requests.post(url, data=body, headers=headers, verify=False)
and I give some error like you can't send a request like that
.
I realize I must send the certificate with this request to have success response
I have .cer
and .crt
files to send it with but I send like this:
response = requests.post(url, data=body, headers=headers, cert=(c1, c2))
and get this error:
OpenSSL.SSL.Error: [('PEM routines', 'PEM_read_bio', 'no start line'), ('SSL routines', 'SSL_CTX_use_PrivateKey_file', 'PEM lib')]
UPDATE:
I use openssl x509 -inform der -in PK.cer -out PK.pem
and try this:
response = requests.post(url, data=body, headers=headers, verify='PK.pem')
But this time I got this error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='49.1.92.38', port=7911): Max retries exceeded with url: /ECARE/CRMInterface_INV_Services (Caused by SSLError(CertificateError("hostname '49.1.92.38' doesn't match 'crm.at.com'",),))
I want to send this soap request with this certificate file but I can't find anything that helps. can anyone help me out?
with regards.