title: CertificateError in sending request
body: <p>I want to send <code>XML</code> to the soap request I use python request like below:</p>
  
  <pre><code>response = requests.post(url, data=body, headers=headers)
  </code></pre>
  
  <p>when I send the request I give this request:</p>
  
  <pre><code>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')],)",),))
  </code></pre>
  
  <p>I make <code>verify=False</code> in a request like this:</p>
  
  <pre><code>response = requests.post(url, data=body, headers=headers, verify=False)
  </code></pre>
  
  <p>and I give some error like <code>you can't send a request like that</code>.</p>
  
  <p>I realize I must send the certificate with this request to have success response</p>
  
  <p>I have <code>.cer</code> and <code>.crt</code> files to send it with but I send like this:</p>
  
  <pre><code>response = requests.post(url, data=body, headers=headers, cert=(c1, c2))
  </code></pre>
  
  <p>and get this error:</p>
  
  <pre><code>OpenSSL.SSL.Error: [('PEM routines', 'PEM_read_bio', 'no start line'), ('SSL routines', 'SSL_CTX_use_PrivateKey_file', 'PEM lib')]
  </code></pre>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I use <code>openssl x509 -inform der -in PK.cer -out PK.pem</code> and try this:</p>
  
  <pre><code>response = requests.post(url, data=body, headers=headers, verify='PK.pem')
  </code></pre>
  
  <p>But this time I got this error:</p>
  
  <pre><code>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'",),))
  </code></pre>
  
  <p>I want to send this soap request with this certificate file but I can't find anything that helps.
  can anyone help me out?</p>
  
  <p>with regards.</p>