Compare commits
10 Commits
ac07069d0c
...
4c21687d77
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c21687d77 | ||
|
|
ee8ccbd098 | ||
|
|
1fe1bf6ea3 | ||
|
|
f7e0c86ea5 | ||
|
|
9b3aff2133 | ||
|
|
6096f33fa2 | ||
|
|
6d9cf42036 | ||
|
|
2d42ab24b5 | ||
|
|
4e677fed1a | ||
|
|
fdaef0a5a4 |
39
0001-change-requires-version.patch
Normal file
39
0001-change-requires-version.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 94ef426..bd1c511 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -73,10 +73,10 @@ setup(
|
||||||
|
# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires
|
||||||
|
# It is not considered best practice to use install_requires to pin dependencies to specific versions.
|
||||||
|
install_requires=[
|
||||||
|
- "asgiref>=3.2.10,<3.6",
|
||||||
|
- "Brotli>=1.0,<1.1",
|
||||||
|
+ "asgiref>=3.2.10",
|
||||||
|
+ "Brotli>=1.0,<=1.1.0",
|
||||||
|
"certifi>=2019.9.11", # no semver here - this should always be on the last release!
|
||||||
|
- "cryptography>=38.0,<38.1",
|
||||||
|
+ "cryptography>=38.0",
|
||||||
|
"flask>=1.1.1,<2.3",
|
||||||
|
"h11>=0.11,<0.15",
|
||||||
|
"h2>=4.1,<5",
|
||||||
|
@@ -87,16 +87,16 @@ setup(
|
||||||
|
"msgpack>=1.0.0, <1.1.0",
|
||||||
|
"passlib>=1.6.5, <1.8",
|
||||||
|
"protobuf>=3.14,<5",
|
||||||
|
- "pyOpenSSL>=22.1,<22.2",
|
||||||
|
- "pyparsing>=2.4.2,<3.1",
|
||||||
|
+ "pyOpenSSL>=22.1",
|
||||||
|
+ "pyparsing>=2.4.2,<=3.1.1",
|
||||||
|
"pyperclip>=1.6.0,<1.9",
|
||||||
|
- "ruamel.yaml>=0.16,<0.18",
|
||||||
|
+ "ruamel.yaml>=0.16,<=0.18.6",
|
||||||
|
"sortedcontainers>=2.3,<2.5",
|
||||||
|
"tornado>=6.1,<7",
|
||||||
|
"urwid>=2.1.1,<2.2",
|
||||||
|
"wsproto>=1.0,<1.3",
|
||||||
|
"publicsuffix2>=2.20190812,<3",
|
||||||
|
- "zstandard>=0.11,<0.20",
|
||||||
|
+ "zstandard>=0.11",
|
||||||
|
"typing-extensions>=4.3,<4.5; python_version<'3.10'",
|
||||||
|
],
|
||||||
|
extras_require={
|
||||||
@ -1,80 +0,0 @@
|
|||||||
From af22a19f18f7997a7c7a3ee4ad60f03ab89b0459 Mon Sep 17 00:00:00 2001
|
|
||||||
From: root <root@localhost.localdomain>
|
|
||||||
Date: Thu, 30 Sep 2021 17:03:09 +0800
|
|
||||||
Subject: [PATCH] fix run in python 3.7 environment
|
|
||||||
|
|
||||||
---
|
|
||||||
mitmproxy/addons/tlsconfig.py | 3 ++-
|
|
||||||
mitmproxy/net/server_spec.py | 5 +++--
|
|
||||||
mitmproxy/proxy/commands.py | 3 ++-
|
|
||||||
mitmproxy/proxy/layers/tls.py | 3 ++-
|
|
||||||
4 files changed, 9 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/mitmproxy/addons/tlsconfig.py b/mitmproxy/addons/tlsconfig.py
|
|
||||||
index 260be64..ee5efde 100644
|
|
||||||
--- a/mitmproxy/addons/tlsconfig.py
|
|
||||||
+++ b/mitmproxy/addons/tlsconfig.py
|
|
||||||
@@ -1,7 +1,8 @@
|
|
||||||
import ipaddress
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
-from typing import List, Optional, TypedDict, Any
|
|
||||||
+from typing import List, Optional, Any
|
|
||||||
+from typing_extensions import TypedDict
|
|
||||||
|
|
||||||
from OpenSSL import SSL
|
|
||||||
from mitmproxy import certs, ctx, exceptions, connection
|
|
||||||
diff --git a/mitmproxy/net/server_spec.py b/mitmproxy/net/server_spec.py
|
|
||||||
index f117774..99c5996 100644
|
|
||||||
--- a/mitmproxy/net/server_spec.py
|
|
||||||
+++ b/mitmproxy/net/server_spec.py
|
|
||||||
@@ -3,7 +3,8 @@ Server specs are used to describe an upstream proxy or server.
|
|
||||||
"""
|
|
||||||
import functools
|
|
||||||
import re
|
|
||||||
-from typing import Tuple, Literal, NamedTuple
|
|
||||||
+from typing import Tuple, NamedTuple
|
|
||||||
+from typing_extensions import Literal
|
|
||||||
|
|
||||||
from mitmproxy.net import check
|
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ server_spec_re = re.compile(
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
-@functools.lru_cache
|
|
||||||
+@functools.lru_cache()
|
|
||||||
def parse(server_spec: str) -> ServerSpec:
|
|
||||||
"""
|
|
||||||
Parses a server mode specification, e.g.:
|
|
||||||
diff --git a/mitmproxy/proxy/commands.py b/mitmproxy/proxy/commands.py
|
|
||||||
index 8f07990..5cada3c 100644
|
|
||||||
--- a/mitmproxy/proxy/commands.py
|
|
||||||
+++ b/mitmproxy/proxy/commands.py
|
|
||||||
@@ -6,7 +6,8 @@ possibly to the master and addons.
|
|
||||||
|
|
||||||
The counterpart to commands are events.
|
|
||||||
"""
|
|
||||||
-from typing import Literal, Union, TYPE_CHECKING
|
|
||||||
+from typing import Union, TYPE_CHECKING
|
|
||||||
+from typing_extensions import Literal
|
|
||||||
|
|
||||||
import mitmproxy.hooks
|
|
||||||
from mitmproxy.connection import Connection, Server
|
|
||||||
diff --git a/mitmproxy/proxy/layers/tls.py b/mitmproxy/proxy/layers/tls.py
|
|
||||||
index c9a2ff2..e2bbb7a 100644
|
|
||||||
--- a/mitmproxy/proxy/layers/tls.py
|
|
||||||
+++ b/mitmproxy/proxy/layers/tls.py
|
|
||||||
@@ -1,7 +1,8 @@
|
|
||||||
import struct
|
|
||||||
import time
|
|
||||||
from dataclasses import dataclass
|
|
||||||
-from typing import Iterator, Literal, Optional, Tuple
|
|
||||||
+from typing import Iterator, Optional, Tuple
|
|
||||||
+from typing_extensions import Literal
|
|
||||||
|
|
||||||
from OpenSSL import SSL
|
|
||||||
from mitmproxy import certs, connection
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
diff -Nur mitmproxy-7.0.0/mitmproxy/contentviews/__init__.py mitmproxy-7.0.0-1/mitmproxy/contentviews/__init__.py
|
|
||||||
--- mitmproxy-7.0.0/mitmproxy/contentviews/__init__.py 2021-07-16 16:24:38.000000000 +0800
|
|
||||||
+++ mitmproxy-7.0.0-1/mitmproxy/contentviews/__init__.py 2021-08-04 15:27:39.221691053 +0800
|
|
||||||
@@ -99,8 +99,10 @@
|
|
||||||
http_message = None
|
|
||||||
if isinstance(message, http.Message):
|
|
||||||
http_message = message
|
|
||||||
- if ctype := message.headers.get("content-type"):
|
|
||||||
- if ct := http.parse_content_type(ctype):
|
|
||||||
+ ctype_tmp = message.headers.get("content-type")
|
|
||||||
+ if ctype == ctype_tmp:
|
|
||||||
+ ct_tmp = http.parse_content_type(ctype)
|
|
||||||
+ if ct == ct_tmp:
|
|
||||||
content_type = f"{ct[0]}/{ct[1]}"
|
|
||||||
|
|
||||||
description, lines, error = get_content_view(
|
|
||||||
diff -Nur mitmproxy-7.0.0/mitmproxy/net/tls.py mitmproxy-7.0.0-1/mitmproxy/net/tls.py
|
|
||||||
--- mitmproxy-7.0.0/mitmproxy/net/tls.py 2021-07-16 16:24:38.000000000 +0800
|
|
||||||
+++ mitmproxy-7.0.0-1/mitmproxy/net/tls.py 2021-08-04 15:32:53.086778204 +0800
|
|
||||||
@@ -106,7 +106,7 @@
|
|
||||||
ok += SSL._lib.SSL_CTX_set_max_proto_version(context._context, max_version.value) # type: ignore
|
|
||||||
if ok != 2:
|
|
||||||
raise RuntimeError(
|
|
||||||
- f"Error setting TLS versions ({min_version=}, {max_version=}). "
|
|
||||||
+ f"Error setting TLS versions ({min_version}, {max_version}). "
|
|
||||||
"The version you specified may be unavailable in your libssl."
|
|
||||||
)
|
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@
|
|
||||||
try:
|
|
||||||
context.load_verify_locations(ca_pemfile, ca_path)
|
|
||||||
except SSL.Error as e:
|
|
||||||
- raise RuntimeError(f"Cannot load trusted certificates ({ca_pemfile=}, {ca_path=}).") from e
|
|
||||||
+ raise RuntimeError(f"Cannot load trusted certificates ({ca_pemfile}, {ca_path}).") from e
|
|
||||||
|
|
||||||
# Client Certs
|
|
||||||
if client_cert:
|
|
||||||
diff -Nur mitmproxy-7.0.0/mitmproxy/proxy/layers/http/__init__.py mitmproxy-7.0.0-1/mitmproxy/proxy/layers/http/__init__.py
|
|
||||||
--- mitmproxy-7.0.0/mitmproxy/proxy/layers/http/__init__.py 2021-07-16 16:24:38.000000000 +0800
|
|
||||||
+++ mitmproxy-7.0.0-1/mitmproxy/proxy/layers/http/__init__.py 2021-08-04 15:30:16.424239006 +0800
|
|
||||||
@@ -148,8 +148,8 @@
|
|
||||||
else:
|
|
||||||
self.flow = event.replay_flow
|
|
||||||
self.flow.request = event.request
|
|
||||||
-
|
|
||||||
- if err := validate_request(self.mode, self.flow.request):
|
|
||||||
+ err_tmp = validate_request(self.mode, self.flow.request)
|
|
||||||
+ if err == err_tmp:
|
|
||||||
self.flow.response = http.Response.make(502, str(err))
|
|
||||||
self.client_state = self.state_errored
|
|
||||||
return (yield from self.send_response())
|
|
||||||
diff -Nur mitmproxy-7.0.0/mitmproxy/proxy/server.py mitmproxy-7.0.0-1/mitmproxy/proxy/server.py
|
|
||||||
--- mitmproxy-7.0.0/mitmproxy/proxy/server.py 2021-07-16 16:24:38.000000000 +0800
|
|
||||||
+++ mitmproxy-7.0.0-1/mitmproxy/proxy/server.py 2021-08-04 15:31:48.925738277 +0800
|
|
||||||
@@ -142,7 +142,8 @@
|
|
||||||
server=command.connection
|
|
||||||
)
|
|
||||||
await self.handle_hook(server_hooks.ServerConnectHook(hook_data))
|
|
||||||
- if err := command.connection.error:
|
|
||||||
+ err_tmp = command.connection.error
|
|
||||||
+ if err == err_tmp:
|
|
||||||
self.log(f"server connection to {human.format_address(command.connection.address)} killed before connect: {err}")
|
|
||||||
self.server_event(events.OpenConnectionCompleted(command, f"Connection killed: {err}"))
|
|
||||||
return
|
|
||||||
Binary file not shown.
@ -1,13 +1,12 @@
|
|||||||
%global _empty_manifest_terminate_build 0
|
%global _empty_manifest_terminate_build 0
|
||||||
Name: python-mitmproxy
|
Name: python-mitmproxy
|
||||||
Version: 7.0.0
|
Version: 9.0.1
|
||||||
Release: 3
|
Release: 2
|
||||||
Summary: An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.
|
Summary: An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/mitmproxy/mitmproxy/
|
URL: https://github.com/mitmproxy/mitmproxy/
|
||||||
Source0: https://github.com/mitmproxy/mitmproxy/archive/refs/tags/v%{version}.tar.gz
|
Source0: https://github.com/mitmproxy/mitmproxy/archive/%{version}/mitmproxy-%{version}.tar.gz
|
||||||
Patch0: fix-build-fail-with-python3.7.patch
|
Patch0001: 0001-change-requires-version.patch
|
||||||
Patch0001: 0001-fix-run-in-python-3.7-environment.patch
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: python3-asgiref python3-blinker python3-Brotli python3-certifi python3-click
|
Requires: python3-asgiref python3-blinker python3-Brotli python3-certifi python3-click
|
||||||
Requires: python3-cryptography python3-flask python3-h11 python3-h2 python3-hyperframe
|
Requires: python3-cryptography python3-flask python3-h11 python3-h2 python3-hyperframe
|
||||||
@ -18,7 +17,6 @@ Requires: python3-publicsuffix2 python3-zstandard python3-pydivert py
|
|||||||
Requires: python3-parver python3-pdoc python3-pyinstaller python3-pytest-asyncio
|
Requires: python3-parver python3-pdoc python3-pyinstaller python3-pytest-asyncio
|
||||||
Requires: python3-pytest-cov python3-pytest-timeout python3-pytest-xdist python3-pytest
|
Requires: python3-pytest-cov python3-pytest-timeout python3-pytest-xdist python3-pytest
|
||||||
Requires: python3-requests python3-tox python3-wheel
|
Requires: python3-requests python3-tox python3-wheel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
mitmproxy is an interactive, SSL/TLS-capable intercepting proxy with a console interface for HTTP/1, HTTP/2, and WebSockets.
|
mitmproxy is an interactive, SSL/TLS-capable intercepting proxy with a console interface for HTTP/1, HTTP/2, and WebSockets.
|
||||||
|
|
||||||
@ -76,6 +74,23 @@ mv %{buildroot}/doclist.lst .
|
|||||||
%{_docdir}/*
|
%{_docdir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Apr 01 2024 Ge Wang <wang__ge@126.com> - 9.0.1-2
|
||||||
|
- Modify installation dependency version limit
|
||||||
|
|
||||||
|
* Tue Sep 19 2023 xu_ping <707078654@qq.com> - 9.0.1-1
|
||||||
|
- Upgrade version to 9.0.1
|
||||||
|
- add Raw UDP and DTLS support.
|
||||||
|
- Deprecate add_log event hook and mitmproxy.ctx.log.
|
||||||
|
|
||||||
|
* Fri Sep 1 2023 liyanan <thistleslyn@163.com> - 7.0.0-6
|
||||||
|
- Modify the installation dependency protobuf version limit
|
||||||
|
|
||||||
|
* Tue Mar 28 2023 liyanan <liyanan32@h-partners.com> - 7.0.0-5
|
||||||
|
- change requires version to fix install issue
|
||||||
|
|
||||||
|
* Fri Oct 15 2021 chemingdao <chemingdao@huawei.com> - 7.0.0-4
|
||||||
|
- fix asynocio utils run in python3.7
|
||||||
|
|
||||||
* Thu Sep 30 2021 chemingdao <chemingdao@huawei.com> - 7.0.0-3
|
* Thu Sep 30 2021 chemingdao <chemingdao@huawei.com> - 7.0.0-3
|
||||||
- fix run in python 3.7 environment
|
- fix run in python 3.7 environment
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user