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 /mitmproxy/proxy | |
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 'mitmproxy/proxy')
-rw-r--r-- | mitmproxy/proxy/protocol/tls.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mitmproxy/proxy/protocol/tls.py b/mitmproxy/proxy/protocol/tls.py index 3f337a2a..3577af13 100644 --- a/mitmproxy/proxy/protocol/tls.py +++ b/mitmproxy/proxy/protocol/tls.py @@ -469,6 +469,7 @@ class TlsLayer(base.Layer): """ host = None sans = set() + o = None # In normal operation, the server address should always be known at this point. # However, we may just want to establish TLS so that we can send an error message to the client, @@ -488,6 +489,8 @@ class TlsLayer(base.Layer): if upstream_cert.cn: sans.add(host) host = upstream_cert.cn.decode("utf8").encode("idna") + if upstream_cert.o: + o = upstream_cert.o # Also add SNI values. if self._client_hello.sni: sans.add(self._client_hello.sni.encode("idna")) @@ -498,4 +501,4 @@ class TlsLayer(base.Layer): # In other words, the Common Name is irrelevant then. if host: sans.add(host) - return self.config.certstore.get_cert(host, list(sans)) + return self.config.certstore.get_cert(host, list(sans), o) |