diff options
| author | Abcdefghijklmnopqrstuvwxyzxyz <huang_yue_zhi@outlook.com> | 2018-11-09 16:06:04 +0800 |
|---|---|---|
| committer | Maximilian Hils <git@maximilianhils.com> | 2018-11-09 09:06:04 +0100 |
| commit | d4f4cfe2252ac82bc361c098e7fba48d70466890 (patch) | |
| tree | 79c840861d323ce4a8980bceb2b0a3ccec2d5406 /test | |
| parent | 3f3ed4743a3dda8901a35aa14d8e1c689933a1a4 (diff) | |
| download | mitmproxy-d4f4cfe2252ac82bc361c098e7fba48d70466890.tar.gz mitmproxy-d4f4cfe2252ac82bc361c098e7fba48d70466890.tar.bz2 mitmproxy-d4f4cfe2252ac82bc361c098e7fba48d70466890.zip | |
Add Organization field for the generated certificate (#3376)
add organization field for the generated certificate
Diffstat (limited to 'test')
| -rw-r--r-- | test/mitmproxy/test_certs.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/mitmproxy/test_certs.py b/test/mitmproxy/test_certs.py index 8421ec58..9b4c9516 100644 --- a/test/mitmproxy/test_certs.py +++ b/test/mitmproxy/test_certs.py @@ -129,18 +129,22 @@ class TestDummyCert: ca.default_privatekey, ca.default_ca, b"foo.com", - [b"one.com", b"two.com", b"*.three.com", b"127.0.0.1"] + [b"one.com", b"two.com", b"*.three.com", b"127.0.0.1"], + b"Foo Ltd." ) assert r.cn == b"foo.com" assert r.altnames == [b'one.com', b'two.com', b'*.three.com'] + assert r.o == b"Foo Ltd." r = certs.dummy_cert( ca.default_privatekey, ca.default_ca, None, - [] + [], + None ) assert r.cn is None + assert r.o is None assert r.altnames == [] @@ -152,6 +156,7 @@ class TestCert: c1 = certs.Cert.from_pem(d) assert c1.cn == b"google.com" assert len(c1.altnames) == 436 + assert c1.o == b"Google Inc" with open(tdata.path("mitmproxy/net/data/text_cert_2"), "rb") as f: d = f.read() |
