Procházet zdrojové kódy

Fix python3 wss (TLS/SSL) connection detection.

Compare the first byte of the handshake against numbers (character
code) as well as string characters.
Joel Martin před 13 roky
rodič
revize
2fa565b375
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      utils/websocket.py

+ 1 - 1
utils/websocket.py

@@ -580,7 +580,7 @@ Sec-WebSocket-Accept: %s\r
             sock.send(s2b(self.policy_response))
             raise self.EClose("Sending flash policy response")
 
-        elif handshake[0] in ("\x16", "\x80"):
+        elif handshake[0] in ("\x16", "\x80", 22, 128):
             # SSL wrap the connection
             if not ssl:
                 raise self.EClose("SSL connection but no 'ssl' module")