title: imaplib python with ssl certificate
body: <p>I'm trying to use imaplib.IMAP4_SSL function but I'm stuck with this error:</p>
  
  <p>[Errno 336265225] _ssl.c:356: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib</p>
  
  <pre><code>try:
          mail = imaplib.IMAP4_SSL(host='imap.gmail.com', port="993", certfile="certIMAP.pem")
  except Exception as e:
          print e
          sys.exit()
  </code></pre>
  
  <p>The certificate has been downloaded with:</p>
  
  <pre><code>echo | openssl s_client -connect imap.gmail.com:993 2&gt;/dev/null | openssl x509 &gt; certIMAP.pem
  </code></pre>
  
  <p>Permission on the file are ok. 
  If I use the keyfile option, they ask me the cert, and then the same error is obtained.
  I could not find example for this function with cert specification.
  Thank you.</p>