title: TLS/SSL socket python server
body: <p>I am trying to build a simple HTTPS server with Python3 using the <code>socket</code> and <code>ssl</code> modules.
  I have a self signed certificate and a private key files generated by OpenSSL and I tried to use them with the ssl module but every time I try, I get a "<em>ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1076)</em>" error.
  My code is</p>
  
  <pre><code>import socket
  import ssl
      context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
      context.load_cert_chain(certfile='cert.pem', keyfile='my_key.key')
      context.verify_mode = ssl.CERT_NONE
      sock = socket.socket()
      sock.bind(('', 443))
      sock.listen(5)
      while True:
          new_conn, addr = sock.accept()
          ssl_conn = context.wrap_socket(new_conn, server_side=True)
          print(ssl_conn.recv(1024).decode())     # this is where i get the error
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>  File "C:\AllInOne\PortableApps\Python374\lib\ssl.py", line 1139, in do_handshake
      self._sslobj.do_handshake()
  ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1076)
  </code></pre>
  
  <p>Does anyone know why this happens or how to fix it?</p>