mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Adapt for new request_client_cert option in netlib.
This commit is contained in:
parent
bc88930fb7
commit
11cc48ca25
@ -1,7 +1,7 @@
|
|||||||
import socket, time
|
import socket, time
|
||||||
import mock
|
import mock
|
||||||
from netlib import tcp, http_auth, http
|
from netlib import tcp, http_auth, http
|
||||||
from libpathod import pathoc
|
from libpathod import pathoc, pathod
|
||||||
import tutils, tservers
|
import tutils, tservers
|
||||||
from libmproxy import flow, proxy
|
from libmproxy import flow, proxy
|
||||||
|
|
||||||
@ -173,6 +173,7 @@ class TestHTTPConnectSSLError(tservers.HTTPProxTest):
|
|||||||
|
|
||||||
class TestHTTPS(tservers.HTTPProxTest, CommonMixin):
|
class TestHTTPS(tservers.HTTPProxTest, CommonMixin):
|
||||||
ssl = True
|
ssl = True
|
||||||
|
ssloptions = pathod.SSLOptions(request_client_cert=True)
|
||||||
clientcerts = True
|
clientcerts = True
|
||||||
def test_clientcert(self):
|
def test_clientcert(self):
|
||||||
f = self.pathod("304")
|
f = self.pathod("304")
|
||||||
|
@ -69,6 +69,7 @@ class ProxyThread(threading.Thread):
|
|||||||
class ProxTestBase:
|
class ProxTestBase:
|
||||||
# Test Configuration
|
# Test Configuration
|
||||||
ssl = None
|
ssl = None
|
||||||
|
ssloptions = False
|
||||||
clientcerts = False
|
clientcerts = False
|
||||||
certfile = None
|
certfile = None
|
||||||
no_upstream_cert = False
|
no_upstream_cert = False
|
||||||
@ -77,8 +78,8 @@ class ProxTestBase:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setupAll(cls):
|
def setupAll(cls):
|
||||||
cls.tqueue = Queue.Queue()
|
cls.tqueue = Queue.Queue()
|
||||||
cls.server = libpathod.test.Daemon(ssl=cls.ssl)
|
cls.server = libpathod.test.Daemon(ssl=cls.ssl, ssloptions=cls.ssloptions)
|
||||||
cls.server2 = libpathod.test.Daemon(ssl=cls.ssl)
|
cls.server2 = libpathod.test.Daemon(ssl=cls.ssl, ssloptions=cls.ssloptions)
|
||||||
pconf = cls.get_proxy_config()
|
pconf = cls.get_proxy_config()
|
||||||
config = proxy.ProxyConfig(
|
config = proxy.ProxyConfig(
|
||||||
no_upstream_cert = cls.no_upstream_cert,
|
no_upstream_cert = cls.no_upstream_cert,
|
||||||
|
Loading…
Reference in New Issue
Block a user