mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 09:37:37 +00:00
cryptography now accepts some more invalid attrs - remove dead code paths
This commit is contained in:
parent
9249c0ddd3
commit
95089486ca
@ -284,18 +284,11 @@ class TlsConfig:
|
||||
# Use upstream certificate if available.
|
||||
if ctx.options.upstream_cert and conn_context.server.certificate_list:
|
||||
upstream_cert = conn_context.server.certificate_list[0]
|
||||
try:
|
||||
# a bit clunky: access to .cn can fail, see https://github.com/mitmproxy/mitmproxy/issues/4713
|
||||
if upstream_cert.cn:
|
||||
altnames.append(upstream_cert.cn)
|
||||
except ValueError:
|
||||
pass
|
||||
if upstream_cert.cn:
|
||||
altnames.append(upstream_cert.cn)
|
||||
altnames.extend(upstream_cert.altnames)
|
||||
try:
|
||||
if upstream_cert.organization:
|
||||
organization = upstream_cert.organization
|
||||
except ValueError:
|
||||
pass
|
||||
if upstream_cert.organization:
|
||||
organization = upstream_cert.organization
|
||||
|
||||
# Add SNI. If not available, try the server address as well.
|
||||
if conn_context.client.sni:
|
||||
|
Loading…
Reference in New Issue
Block a user