title: SSLError: Python Server Failure (HTTP_REQUEST _ssl.c:777)
body: <p>My application has a server wherein waiting for a connection is made as follow:</p>
  
  <pre><code>sckt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  server = ('', port_server)
  sckt.bind(server)
  sckt.listen(5)
  try:
      while True:
          new_sckt, client = sckt.accept()
          conn = ssl.wrap_socket(new_sckt, server_side=True, ca_certs=certClient, cert_reqs=ssl.CERT_REQUIRED, certfile=certServer, keyfile=keyServer)
          _thread.start_new_thread(self.waitUserCommand, tuple([conn, client]))
  finally:
      conn.close()
  </code></pre>
  
  <p>The client connects to server by:</p>
  
  <pre><code>sckt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  conn = ssl.wrap_socket(sckt, server_side=False, ca_certs=certServer, cert_reqs = ssl.CERT_REQUIRED, certfile=certClient, keyfile=keyClient)
  conn.connect((ip_server, port_server))
  </code></pre>
  
  <p>The failure occurs after some client connections, appearing the followed message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "server.py", line 260, in &lt;module&gt;
      server.startServer()
    File "server.py", line 90, in startServer
      keyfile=keyServer)
    File "/usr/local/lib/python3.6/ssl.py", line 1149, in wrap_socket
      ciphers=ciphers)
    File "/usr/local/lib/python3.6/ssl.py", line 814, in __init__
      self.do_handshake()
    File "/usr/local/lib/python3.6/ssl.py", line 1068, in do_handshake
      self._sslobj.do_handshake()
    File "/usr/local/lib/python3.6/ssl.py", line 689, in do_handshake
      self._sslobj.do_handshake()
  ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:777)
  </code></pre>
  
  <p>It is interesting to mention that this error occurs after the end of a connection and before the start of the next connection. i.e., the client is offline and the server is only waiting a new connection (without executing anything). Besides, my application uses another server that works in a similar manner but no failure with it occurred in my experiments.</p>