response = yield agent.request('GET', 'https://your-web-site.example.com/')
done = Deferred()


class CaptureString(Protocol):

    def dataReceived(self, data):
        print(('Received:', data))

def connectionLost(self, reason):
    done.callback(None)
response.deliverBody(CaptureString())
yield done
react(main)
Twisted Python Как создать файл twisted.web.client.BrowserLikePolicyForHTTPS с пользовательским trustRoot?