catch malformed cert warning in tests

we may need to catch this properly in `get_cert` at some point,
let's see if this ever turns out to be an issue.
This commit is contained in:
Maximilian Hils 2021-11-22 12:55:17 +01:00
parent 9803c90341
commit 2dd845ed95
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ class TestTlsConfig:
with open(tdata.path("mitmproxy/data/invalid-subject.pem"), "rb") as f:
ctx.server.certificate_list = [certs.Cert.from_pem(f.read())]
assert ta.get_cert(ctx) # does not raise
with pytest.warns(UserWarning, match="Country names should be two characters"):
assert ta.get_cert(ctx) # does not raise
def test_tls_clienthello(self):
# only really testing for coverage here, there's no point in mirroring the individual conditions