aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2015-06-30 10:51:46 +1200
committerAldo Cortesi <aldo@corte.si>2015-06-30 10:51:46 +1200
commit5ad6773e78404fc10f694ebf2f2d72d28df617a3 (patch)
treea22397901680338545ee69d614ed418e40528475 /test/test_proxy.py
parentaebad44d550d917489c802d0d51e1002f87b4e3b (diff)
parentf0ad1f334ca57fdf57a3bfb190d314fc8d983475 (diff)
downloadmitmproxy-5ad6773e78404fc10f694ebf2f2d72d28df617a3.tar.gz
mitmproxy-5ad6773e78404fc10f694ebf2f2d72d28df617a3.tar.bz2
mitmproxy-5ad6773e78404fc10f694ebf2f2d72d28df617a3.zip
Merge pull request #661 from kyle-m/master
Enabling upstream server verification.
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r--test/test_proxy.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index d1e72f75..77051edd 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -9,6 +9,8 @@ from libpathod import test
from netlib import http, tcp
import mock
+from OpenSSL import SSL
+
def test_proxy_error():
p = ProxyError(111, "msg")
@@ -133,6 +135,20 @@ class TestProcessProxyOptions:
"--singleuser",
"test")
+ def test_verify_upstream_cert(self):
+ p = self.assert_noerr("--verify-upstream-cert")
+ assert p.openssl_verification_mode_server == SSL.VERIFY_PEER
+
+ def test_upstream_trusted_cadir(self):
+ expected_dir = "/path/to/a/ca/dir"
+ p = self.assert_noerr("--upstream-trusted-cadir", expected_dir)
+ assert p.openssl_trusted_cadir_server == expected_dir
+
+ def test_upstream_trusted_ca(self):
+ expected_file = "/path/to/a/cert/file"
+ p = self.assert_noerr("--upstream-trusted-ca", expected_file)
+ assert p.openssl_trusted_ca_server == expected_file
+
class TestProxyServer:
# binding to 0.0.0.0:1 works without special permissions on Windows