From c2ae8285f4bc092a449d92f4bbdb150d586c2c51 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 20 Feb 2011 12:53:42 +1300 Subject: Revamp SSL configuration. - Move option parsing utiliities to proxy.py - Don't have a global config object. Pass it as an argument to ProxyServer. - Simplify certificate generation logic. --- test/test_proxy.py | 3 +-- test/test_utils.py | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test_proxy.py b/test/test_proxy.py index 0b40164e..0c05aeb2 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -15,7 +15,7 @@ HTTPS_PORT = random.randint(30000, 40000) class TestMaster(controller.Master): def __init__(self, port, testq): - serv = proxy.ProxyServer(port) + serv = proxy.ProxyServer(proxy.Config("data/testkey.pem"), port) controller.Master.__init__(self, serv) self.testq = testq self.log = [] @@ -54,7 +54,6 @@ class ServerThread(threading.Thread): class _TestServers(libpry.TestContainer): def setUpAll(self): - proxy.config = proxy.Config("data/testkey.pem") self.tqueue = Queue.Queue() # We don't make any concurrent requests, so we can access # the attributes on this object safely. diff --git a/test/test_utils.py b/test/test_utils.py index a52c8e3b..f65c1ea7 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -293,6 +293,12 @@ class udummy_cert(libpry.AutoTree): "foo.com" ) assert os.path.exists(os.path.join(d, "foo", "foo.com.pem")) + # Short-circuit + assert utils.dummy_cert( + os.path.join(d, "foo"), + cacert, + "foo.com" + ) def test_no_ca(self): d = self.tmpdir() -- cgit v1.2.3