mitmproxy/libmproxy/protocol2/rawtcp.py

22 lines
633 B
Python
Raw Normal View History

from __future__ import (absolute_import, print_function, division)
import OpenSSL
from ..exceptions import ProtocolException
2015-07-24 16:29:13 +00:00
from ..protocol.tcp import TCPHandler
2015-07-25 11:31:55 +00:00
from .layer import Layer
from .messages import Connect
2015-07-24 16:29:13 +00:00
class TcpLayer(Layer):
def __call__(self):
yield Connect()
tcp_handler = TCPHandler(self)
try:
tcp_handler.handle_messages()
except OpenSSL.SSL.Error as e:
raise ProtocolException("SSL error: %s" % repr(e), e)
2015-07-24 16:29:13 +00:00
def establish_server_connection(self):
pass
# FIXME: Remove method, currently just here to mock TCPHandler's call to it.