Make HTTPS protocols work with the protocol switcher magic.
This commit is contained in:
parent
11f4ebc0d9
commit
981b693402
|
@ -138,6 +138,13 @@ class _FoolscapOrHttps(Protocol, metaclass=_PretendToBeNegotiation):
|
||||||
protocol = self.https_factory.buildProtocol(self.transport.getPeer())
|
protocol = self.https_factory.buildProtocol(self.transport.getPeer())
|
||||||
protocol.makeConnection(self.transport)
|
protocol.makeConnection(self.transport)
|
||||||
protocol.dataReceived(self._buffer)
|
protocol.dataReceived(self._buffer)
|
||||||
|
|
||||||
|
# Update the factory so it knows we're transforming to a new
|
||||||
|
# protocol object (we'll do that next)
|
||||||
|
value = self.https_factory.protocols.pop(protocol)
|
||||||
|
self.https_factory.protocols[self] = value
|
||||||
|
|
||||||
|
# Transform self into the TLS protocol 🪄
|
||||||
self.__class__ = protocol.__class__
|
self.__class__ = protocol.__class__
|
||||||
self.__dict__ = protocol.__dict__
|
self.__dict__ = protocol.__dict__
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue