title: Python3: get resource from https server with client certificate authentication
body: <p>I have a problem getting html page from https server. Access to the resource is secured with client certificate verification (in a browser I must choose proper certificate to access page).</p>
  
  <p>I am trying to use python's <code>http.client</code> library like this:</p>
  
  <pre><code>import http.client
  conn = http.client.HTTPSConnection('example.com', 443, key_file = 'tmp/private.pem', cert_file = 'tmp/public.pem')
  conn.set_debuglevel(0)
  conn.request('GET', '/index.htm')
  result = conn.getresponse()
  if result.status != http.client.ACCEPTED:
    pass
  print(result.status, result.reason)
  conn.close()
  </code></pre>
  
  <p>As an output from this program I get: <code>403 Forbidden</code>. What am I doing wrong?</p>
  
  <p>Note that I can access this resource directly through browser. The private and public keys are extracted from pkcs12 file exported from that browser with openssl commands (<code>openssl pkcs12 -nocerts -nodes -in cert.p12 -out private.pem</code> and <code>openssl pkcs12 -nokeys -in cert.p12 -out public.pem</code>)</p>