title: SSL in Python: Why it doesn't send certificate to server?
body: <p>I'm writing some software that is supposed to acquire information from SSL-secured web page. Below there's piece of code I use to connect to server.</p>
  
  <pre><code>s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
  ssl_sock = ssl.wrap_socket (
      s,
      ca_certs = '/home/stilz/Desktop/Certyfikaty/GLOWNE_CA.cer',
      cert_reqs = ssl.CERT_REQUIRED,
      ssl_version = ssl.PROTOCOL_SSLv3,
  )
  ssl_sock.connect ((HOST, PORT))
  </code></pre>
  
  <p>However, this doesn't work. It throws exception with message "Handshake alert failed". I captured some TCP packets that come out of my script and also corresponding packets from Internet Explorer and figured out that my script doesn't send certificate at all (server returns something like "Fatal: no certificate supplied") while IE sends it normally. As far as I know file ca.cer is x509 certificate (beginning with "-----BEGIN CERTIFICATE-----").</p>
  
  <p>Please help me and tell what I'm doing wrong. If I've supplied to few information, please let me know.</p>
  
  <p>Regards</p>