Skip to content

Commit

Permalink
Revert "Remove use of vulnerable HTTPS policy from sandbox"
Browse files Browse the repository at this point in the history
This reverts commit d822b65.
  • Loading branch information
Kaitlyn Crawford committed May 5, 2017
1 parent d822b65 commit 89d0a42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vumi/application/sandbox.py
Expand Up @@ -22,7 +22,7 @@
succeed)
from twisted.internet.error import ProcessDone
from twisted.python.failure import Failure
from twisted.web.client import Agent
from twisted.web.client import WebClientContextFactory, Agent

from OpenSSL.SSL import (
VERIFY_PEER, VERIFY_FAIL_IF_NO_PEER_CERT, VERIFY_CLIENT_ONCE, VERIFY_NONE,
Expand Down Expand Up @@ -918,6 +918,9 @@ def _make_request_from_command(self, method, command):
def _make_request(self, method, url, headers=None, data=None, files=None,
timeout=None, context_factory=None,
data_limit=None):
context_factory = (context_factory if context_factory is not None
else WebClientContextFactory())

if headers is not None:
headers = dict((k.encode("utf-8"), [x.encode("utf-8") for x in v])
for k, v in headers.items())
Expand All @@ -933,10 +936,7 @@ def _make_request(self, method, url, headers=None, data=None, files=None,
StringIO(base64.b64decode(value['data']))))
for key, value in files.iteritems()])

kwargs = {}
if context_factory is not None:
kwargs['contextFactory'] = context_factory
agent = self.agent_class(reactor, **kwargs)
agent = self.agent_class(reactor, contextFactory=context_factory)
http_client = self.http_client_class(agent)

d = http_client.request(method, url, headers=headers, data=data,
Expand Down

0 comments on commit 89d0a42

Please sign in to comment.