aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_proxy.py
diff options
context:
space:
mode:
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