From 1bde4956e6b699adbd311870656f390b512f94fd Mon Sep 17 00:00:00 2001 From: joamag Date: Fri, 20 Apr 2018 17:55:28 +0100 Subject: [PATCH 1/3] initial upgrade ssl support --- src/netius/base/protocol.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/netius/base/protocol.py b/src/netius/base/protocol.py index 47ce3af53..08d4e09a8 100644 --- a/src/netius/base/protocol.py +++ b/src/netius/base/protocol.py @@ -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 @@ -391,3 +392,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 update_ssl(self): + # ensures that there's a transport defined for the current + # transports as that's required for the upgrade + 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") From c493bd0f0fe9c2ab804b01dc484026bdba4c2cbf Mon Sep 17 00:00:00 2001 From: joamag Date: Fri, 20 Apr 2018 17:55:43 +0100 Subject: [PATCH 2/3] new callback support --- src/netius/base/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netius/base/protocol.py b/src/netius/base/protocol.py index 08d4e09a8..a5d01e18d 100644 --- a/src/netius/base/protocol.py +++ b/src/netius/base/protocol.py @@ -393,7 +393,7 @@ def send(self, data, delay = True, force = False, callback = None): # explicitly sent through the associated transport return len(data) - def update_ssl(self): + def update_ssl(self, callback = None): # ensures that there's a transport defined for the current # transports as that's required for the upgrade util.verify( From 587cb68ed4fbed663a72907c4fc09c84c03de102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Thu, 6 Jul 2023 00:07:51 +0100 Subject: [PATCH 3/3] chore: rename update ssl method --- src/netius/base/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netius/base/protocol.py b/src/netius/base/protocol.py index c98802318..af5986f01 100644 --- a/src/netius/base/protocol.py +++ b/src/netius/base/protocol.py @@ -395,9 +395,9 @@ def send(self, data, delay = True, force = False, callback = None): # explicitly sent through the associated transport return len(data) - def update_ssl(self, callback = None): + def upgrade_ssl(self, callback = None): # ensures that there's a transport defined for the current - # transports as that's required for the upgrade + # 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"