Skip to content
12 changes: 12 additions & 0 deletions src/netius/base/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
__license__ = "Apache License, Version 2.0"
""" The license for the module """

from . import util
from . import legacy
from . import request
from . import observer
Expand Down Expand Up @@ -393,3 +394,14 @@ def send(self, data, delay = True, force = False, callback = None):
# returns the size (in bytes) of the data that has just been
# explicitly sent through the associated transport
return len(data)

def upgrade_ssl(self, callback = None):
# ensures that there's a transport defined for the current
# protocol, as that's required for the upgrade operation
util.verify(
not self._transport == None,
message = "To upgrade a connection the transport must be defined"
)

#@todo upgrade this socket to SSL
socket = self._transport.get_extra_info("socket")