abhinavsingh / proxy.py

💫 Ngrok FRP Alternative • ⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • 😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Man's VPN • ⏪ Reverse & ⏩ Forward • 👮🏿 "Proxy Server" framework • 🌐 "Web Server" framework • ➵ ➶ ➷ ➠ "PubSub" framework • 👷 "Work" acceptor & executor framework

Home Page:https://abhinavsingh.com/proxy-py-a-lightweight-single-file-http-proxy-server-in-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ssl.SSLEOFError: EOF occurred in violation of protocol

Y-GM opened this issue · comments

commented

System: Windows
Certificate: OpenSSL

Code OpenSSL:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365

Code Proxy :
proxy --cert-file cert.pem --key-file key.pem

Error:

Traceback (most recent call last):
  File "C:\Users\Lora\AppData\Roaming\Python\Python39\site-packages\proxy\http\handler.py", line 326, in run
    self.initialize()
  File "C:\Users\Lora\AppData\Roaming\Python\Python39\site-packages\proxy\http\handler.py", line 63, in initialize
    super().initialize()
  File "C:\Users\Lora\AppData\Roaming\Python\Python39\site-packages\proxy\core\base\tcp_server.py", line 129, in initialize
    conn = self._optionally_wrap_socket(self.work.connection)
  File "C:\Users\Lora\AppData\Roaming\Python\Python39\site-packages\proxy\core\base\tcp_server.py", line 240, in _optionally_wrap_socket
    conn = wrap_socket(conn, self.flags.keyfile, self.flags.certfile)
  File "C:\Users\Lora\AppData\Roaming\Python\Python39\site-packages\proxy\common\utils.py", line 232, in wrap_socket
    return ctx.wrap_socket(
  File "c:\program files\python39\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "c:\program files\python39\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "c:\program files\python39\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)

@mo161997 Please take a look at this section https://github.com/abhinavsingh/proxy.py#oserror-when-wrapping-client-for-tls-interception Let me know if it helps explain why u r seeing this. Best

Hint: This likely will not happen if you use httpbin but can happen if you are hitting adobe, apple, specific google server endpoints.