Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP client support #27

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions src/netius/base/protocol.py
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")