mitmproxy/test/test_app.py
Aldo Cortesi d65f2215cb Much more sophisticated cert handling
- Specify per-domain certificates and keys
- Certs are no longer regenerated for SANs
- And more. :)
2014-03-05 17:28:04 +13:00

18 lines
498 B
Python

import mock, socket, os, time
from libmproxy import dump
from netlib import certutils, tcp
from libpathod.pathoc import Pathoc
import tutils, tservers
class TestApp(tservers.HTTPProxTest):
def test_basic(self):
assert self.app("/").status_code == 200
def test_cert(self):
with tutils.tmpdir() as d:
for ext in ["pem", "p12"]:
resp = self.app("/cert/%s" % ext)
assert resp.status_code == 200
assert resp.content