von / PerProxy

A python-based proxy that uses Perspectives to detect and thwart SSL MITM attacks.
7 stars 2 forks source link

Need to handle errors in sendall() #26

Closed von closed 13 years ago

von commented 13 years ago
Exception happened during processing of request from ('127.0.0.1', 50108)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 639, in __init__
    self.handle()
  File "./PerProxy.py", line 105, in handle
    self.pass_through(server)
  File "./PerProxy.py", line 214, in pass_through
    out.sendall(data)
  File "./PerProxy.py", line 143, in sendall
    self.request.sendall(msg)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 207, in sendall
    v = self.send(data[count:])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 176, in send
    v = self._sslobj.write(data)
error: [Errno 32] Broken pipe
----------------------------------------
von commented 13 years ago

Same is true for reads:

Exception happened during processing of request from ('127.0.0.1', 50370)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 639, in __init__
    self.handle()
  File "./PerProxy.py", line 103, in handle
    self.handle_server_error(server_error)
  File "./PerProxy.py", line 236, in handle_server_error
    method, path, protocol, headers = self.read_header()
  File "./PerProxy.py", line 256, in read_header
    request = self.readline()
  File "./PerProxy.py", line 282, in readline
    line += self.request.recv(1)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 219, in recv
    return self.read(buflen)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 138, in read
    return self._sslobj.read(len)
error: [Errno 54] Connection reset by peer
----------------------------------------```