From eea24bc22dccd0f8bd5b6e6e7d3de2369d725704 Mon Sep 17 00:00:00 2001 From: "requires.io" Date: Mon, 22 Nov 2021 10:50:47 +0100 Subject: [PATCH 1/4] [requires.io] dependency update --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index cbd69e163..d76276263 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ commands = [testenv:flake8] deps = - flake8>=3.8.4,<4 + flake8>=4.0,<4.1 flake8-tidy-imports>=4.2.0,<5 commands = flake8 --jobs 8 mitmproxy examples test release {posargs} @@ -30,11 +30,11 @@ commands = [testenv:mypy] deps = mypy==0.910 - types-certifi==2020.4.0 - types-Flask==1.1.3 - types-Werkzeug==1.0.5 - types-requests==2.25.9 - types-cryptography==3.3.5 + types-certifi==2021.10.8.0 + types-Flask==1.1.5 + types-Werkzeug==1.0.7 + types-requests==2.26.0 + types-cryptography==3.3.8 types-pyOpenSSL==21.0.0 commands = From dae098cd33194c9a0d42cde2ffdf2ceba239943b Mon Sep 17 00:00:00 2001 From: "requires.io" Date: Mon, 22 Nov 2021 10:50:48 +0100 Subject: [PATCH 2/4] [requires.io] dependency update --- setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 2ab7a6fea..3391aead7 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ setup( "Brotli>=1.0,<1.1", "certifi>=2019.9.11", # no semver here - this should always be on the last release! "click>=7.0,<8.1", - "cryptography>=3.3,<3.5", + "cryptography>=36.0,<36.1", "flask>=1.1.1,<2.1", "h11>=0.11,<0.13", "h2>=4.1,<5", @@ -81,11 +81,11 @@ setup( "ldap3>=2.8,<2.10", "msgpack>=1.0.0, <1.1.0", "passlib>=1.6.5, <1.8", - "protobuf>=3.14,<3.19", + "protobuf>=3.19,<3.20", "pyOpenSSL>=21.0,<21.1", - "pyparsing>=2.4.2,<2.5", + "pyparsing>=3.0,<3.1", "pyperclip>=1.6.0,<1.9", - "ruamel.yaml>=0.16,<0.17.17", + "ruamel.yaml>=0.17,<0.18", # Kaitai parsers depend on setuptools, remove once https://github.com/kaitai-io/kaitai_struct_python_runtime/issues/62 is fixed "setuptools", "sortedcontainers>=2.3,<2.5", @@ -93,7 +93,7 @@ setup( "urwid>=2.1.1,<2.2", "wsproto>=1.0,<1.1", "publicsuffix2>=2.20190812,<3", - "zstandard>=0.11,<0.16", + "zstandard>=0.16,<0.17", ], extras_require={ ':sys_platform == "win32"': [ @@ -103,16 +103,16 @@ setup( "hypothesis>=5.8,<7", "parver>=0.1,<2.0", "pdoc>=4.0.0", - "pyinstaller==4.5.1", + "pyinstaller==4.7", "pytest-asyncio>=0.10.0,<0.16,!=0.14", - "pytest-cov>=2.7.1,<3", - "pytest-timeout>=1.3.3,<2", + "pytest-cov>=3.0,<3.1", + "pytest-timeout>=2.0,<2.1", "pytest-xdist>=2.1.0,<3", "pytest>=6.1.0,<7", "requests>=2.9.1,<3", "tox>=3.5,<4", "wheel>=0.36.2,<0.38", - "coverage==5.5", # workaround issue with import errors introduced in 5.6b1/6.0 + "coverage==6.1.2", # workaround issue with import errors introduced in 5.6b1/6.0 ], } ) From 9249c0ddd37a55657e3714bff0bbef5bba464631 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 22 Nov 2021 11:09:04 +0100 Subject: [PATCH 3/4] adjust lower version bounds --- setup.py | 15 +++++++-------- tox.ini | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 3391aead7..b41c456bc 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ setup( "Brotli>=1.0,<1.1", "certifi>=2019.9.11", # no semver here - this should always be on the last release! "click>=7.0,<8.1", - "cryptography>=36.0,<36.1", + "cryptography>=3.3,<37,!=35", "flask>=1.1.1,<2.1", "h11>=0.11,<0.13", "h2>=4.1,<5", @@ -81,11 +81,11 @@ setup( "ldap3>=2.8,<2.10", "msgpack>=1.0.0, <1.1.0", "passlib>=1.6.5, <1.8", - "protobuf>=3.19,<3.20", + "protobuf>=3.14,<3.20", "pyOpenSSL>=21.0,<21.1", - "pyparsing>=3.0,<3.1", + "pyparsing>=2.4.2,<3.1", "pyperclip>=1.6.0,<1.9", - "ruamel.yaml>=0.17,<0.18", + "ruamel.yaml>=0.16,<0.18", # Kaitai parsers depend on setuptools, remove once https://github.com/kaitai-io/kaitai_struct_python_runtime/issues/62 is fixed "setuptools", "sortedcontainers>=2.3,<2.5", @@ -93,7 +93,7 @@ setup( "urwid>=2.1.1,<2.2", "wsproto>=1.0,<1.1", "publicsuffix2>=2.20190812,<3", - "zstandard>=0.16,<0.17", + "zstandard>=0.11,<0.17", ], extras_require={ ':sys_platform == "win32"': [ @@ -105,14 +105,13 @@ setup( "pdoc>=4.0.0", "pyinstaller==4.7", "pytest-asyncio>=0.10.0,<0.16,!=0.14", - "pytest-cov>=3.0,<3.1", - "pytest-timeout>=2.0,<2.1", + "pytest-cov>=2.7.1,<3.1", + "pytest-timeout>=1.3.3,<2.1", "pytest-xdist>=2.1.0,<3", "pytest>=6.1.0,<7", "requests>=2.9.1,<3", "tox>=3.5,<4", "wheel>=0.36.2,<0.38", - "coverage==6.1.2", # workaround issue with import errors introduced in 5.6b1/6.0 ], } ) diff --git a/tox.ini b/tox.ini index d76276263..0a28c8316 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ commands = [testenv:flake8] deps = - flake8>=4.0,<4.1 + flake8>=3.8.4,<4.1 flake8-tidy-imports>=4.2.0,<5 commands = flake8 --jobs 8 mitmproxy examples test release {posargs} @@ -39,7 +39,7 @@ deps = commands = mypy {posargs} - + [testenv:individual_coverage] commands = python ./test/individual_coverage.py {posargs} From 95089486ca1be80b408f32d131b62a5ec7d75ce6 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 22 Nov 2021 11:14:15 +0100 Subject: [PATCH 4/4] cryptography now accepts some more invalid attrs - remove dead code paths --- mitmproxy/addons/tlsconfig.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mitmproxy/addons/tlsconfig.py b/mitmproxy/addons/tlsconfig.py index 548a95a87..416532bc9 100644 --- a/mitmproxy/addons/tlsconfig.py +++ b/mitmproxy/addons/tlsconfig.py @@ -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: