Maximilian Hils
b089c5fb83
fix #7452 ( #7666 )
...
* savehar: gracefully handle if `content` raises, fix #7452
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-23 12:30:50 +00:00
Jordan Adams
ce151531f8
Add CRL to dummy certs ( #7609 )
...
Co-authored-by: Gabriel Huber <mail@gabrielhuber.at>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-04-22 15:29:41 +02:00
Maximilian Hils
d0a35dcf9b
introduce new contentview API ( #7623 )
2025-04-21 14:56:58 +02:00
Maximilian Hils
f29f146ed1
switch to uv ( #7662 )
2025-04-16 18:38:35 +02:00
Gaurav Jain
c281f76366
Wireguard: Bind server on IPv4 and IPv6 separately ( #7589 )
...
* Wireguard: Handle binding on IPv4 and IPv6 separately
* [autofix.ci] apply automated fixes
* cleanup
* [autofix.ci] apply automated fixes
* cleanup++
* [autofix.ci] apply automated fixes
* Add comments
* Format IPv6 address for new rust API
* Add test
* Update CHANGELOG.md
* [autofix.ci] apply automated fixes
* bump mitmproxy_rs verison
* fix process handler
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-04-14 15:46:55 +00:00
Mark Kiami
d33090b4f3
Log streamed bodies ( #7637 )
...
* Add new feature: storing of request and response streaming bodies
* Fix unit test by regenerating the options file with options_js.py
* Add test cases with store_streamed_bodies True and False
* Update Changelog
* Update Changelog with pull request ID
* [autofix.ci] apply automated fixes
* Update test with a dedicated test case for store_streamed_bodies
* Remove unnecessary option store_streamed_bodies from options.py
* Update docstrings for store_streamed_bodies and stream_large_bodies.
* Update docstring for store_streamed_bodies since it is not used anywhere in practice here.
* Fix typo in test_http.py
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-07 20:09:53 +02:00
Maximilian Hils
3c7c3ccfd5
fixup url.unparse ( #7624 )
...
the parse implementation is still awful, but this is a bit of progress
2025-03-28 22:44:11 +00:00
Maximilian Hils
cc6da7a819
Do not send empty HTTP/2 data frames unless the client sent some ( #7574 )
...
* do not send empty HTTP/2 data frames unless the client sent some, fix #7480
Co-authored-by: Yubao Liu <yubao.liu@gmail.com>
* [autofix.ci] apply automated fixes
* Update CHANGELOG.md
* tests++
---------
Co-authored-by: Yubao Liu <yubao.liu@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-28 20:47:08 +00:00
Maximilian Hils
60e3044e72
Pick random ports that work with both TCP and UDP ( #7618 )
...
* pick random ports that work with both TCP and UDP
fix #7614
* [autofix.ci] apply automated fixes
* Update free_port.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-28 21:24:03 +01:00
Maximilian Hils
4d798c29e2
Support HTTP_1_1_UPGRADE_REQUIRED, refactor protocol error status codes ( #7575 )
...
* http: add error code enum, handle http_1_1_upgrade_required
* http2: add http_1_1_upgrade_required test
* [autofix.ci] apply automated fixes
* move error conversions out of error enum
* fixup coverage
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-25 18:16:03 +01:00
Maximilian Hils
8d96ce7824
Fix CI: actually test on older Python versions ( #7586 )
...
* actually test on older Python versions
* fix tests on Python 3.12
2025-03-01 22:57:48 +00:00
Maximilian Hils
e89377ad9e
Add Support for TLS 1.3 Post Handshake Authentication ( #7576 )
...
* send post_handshake_auth tls extension if client certs are set
* tls: send data only after calling recv
* tls: add post-handshake-authentication test
* [autofix.ci] apply automated fixes
* Update CHANGELOG.md
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-02 01:14:06 +05:30
Maximilian Hils
7c1e429f71
keepserving: do not exit before client has disconnected ( #7571 )
...
* keepserving: do not exit before client has disconnected
* [autofix.ci] apply automated fixes
* fix tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-25 10:35:23 +00:00
DenizenB
372186f255
Content view for socket.io over websocket transport ( #7570 )
...
* socket.io content view for websocket transport
* [autofix.ci] apply automated fixes
* create tests, implement render priority
* [autofix.ci] apply automated fixes
* fix tox errors
* update changelog
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-24 11:41:47 +01:00
Maximilian Hils
8e4c695fce
Ensure export output has no surrogates ( #7562 )
...
* ensure export output has no surrogates
fix https://github.com/mitmproxy/mitmproxy/issues/7561
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-16 13:10:45 +01:00
Maximilian Hils
0bd573a599
web: add password-based authentication
2025-02-05 23:37:33 +01:00
Maximilian Hils
fa89055e19
web: add token-based authentication for the web ui API
2025-02-05 23:37:33 +01:00
Farid Rener
032e51e399
Unescape escaped characters in curl and httpie args ( #7520 )
...
* Unescape escaped characters in curl and httpie args
Fixes: [#7517 ]
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-03 15:48:47 +01:00
dependabot[bot]
77d1f278e1
Update ruff requirement from <=0.8.6,>=0.5.0 to >=0.5.0,<=0.9.4 ( #7528 )
...
* Update ruff requirement from <=0.8.6,>=0.5.0 to >=0.5.0,<=0.9.4
Updates the requirements on [ruff](https://github.com/astral-sh/ruff ) to permit the latest version.
- [Release notes](https://github.com/astral-sh/ruff/releases )
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md )
- [Commits](https://github.com/astral-sh/ruff/compare/0.5.0...0.9.4 )
---
updated-dependencies:
- dependency-name: ruff
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* [autofix.ci] apply automated fixes
* fixup
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2025-02-01 23:21:33 +00:00
Aditya
0013825c1d
fixes #7457 : streamline filter expression case-sensitivity ( #7483 )
...
* make all filter expressions case-insensitive by default
* [autofix.ci] apply automated fixes
* add test cases.
* added dedicated test case for case sensitivity check
---------
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-29 20:06:36 +01:00
Maximilian Hils
6138d2a067
Next Layer: Don't wait for host header based on alpn ( #7519 )
...
* don't wait for host header based on alpn, fix #7516
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-28 17:34:17 +01:00
Sujal Singh
c5402a490a
Check flow.killable before killing prior knowledge h2 connections. ( #7514 )
...
* check for killable flow
* [autofix.ci] apply automated fixes
* add test
* changelog
* restructure test
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-27 14:59:27 +01:00
Maximilian Hils
b761cb46c4
Web: harden xsrf_token usage ( #7491 )
...
web: harden `xsrf_token` usage
2025-01-19 20:40:55 +05:30
Maximilian Hils
e78ab0ffd9
web: remove unnecessary template copying build step ( #7490 )
2025-01-17 18:09:45 +01:00
Maximilian Hils
54829b58c1
dns resolver: make Hickory and getaddrinfo resolvers available using the same protocol ( #7464 )
...
* dns resolver: make Hickory and `getaddrinfo` resolvers available using the same protocol
* incorporate review feedback
2025-01-09 20:22:56 +05:30
Matteo Luppi
70e59c2d41
Remove check for status codes in the blocklist add-on ( #7453 )
...
* remove check status code
* fix tests
* update changelog
* Update changelog
Co-authored-by: lups2000 <100372313+lups2000@users.noreply.github.com>
Co-authored-by: AdityaPatadiya <patadiyaaditya0079@gmail.com>
---------
Co-authored-by: AdityaPatadiya <patadiyaaditya0079@gmail.com>
2025-01-08 10:54:43 +01:00
Jakub Wądołowski
784ad4be20
fix: Remove filter expression lowercasing in block_list addon ( #7456 )
...
* fix: Remove filter expression lowercasing in block_list addon
* chore: CHANGELOG update
* test: Add new test cases to verify URL case-sensitivity
* test: Add new test cases to cover case-sensitive filter expressions
* chore: Update test func name
* fix nits
---------
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2025-01-07 21:55:50 +00:00
Maximilian Hils
9957abf106
fix use of asyncio.create_task ( #7443 )
2025-01-06 11:39:15 +01:00
Maximilian Hils
6e4cb235fd
require Python 3.12+ ( #7440 )
2025-01-06 09:02:51 +00:00
Maximilian Hils
77e0469635
Refine handling of invalid request transfer-encodings ( #7373 )
...
* refine handling of invalid request transfer-encodings
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-05 10:00:12 +01:00
Maximilian Hils
18eb29c736
Improve transfer-encoding error messages, be more permissive if validate_inbound_headers is disabled ( #7361 )
...
* improve error message for header validation
* move transfer-encoding validation from http.http1.read to http.validate
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-28 18:20:27 +00:00
Maximilian Hils
29918474b7
Don't crash UI on negative durations ( #7358 )
...
* don't crash on negative durations, fix #6646
* tests++
2024-11-27 10:07:07 +00:00
Maximilian Hils
8fa4717fc2
Hardening: unify header validation across HTTP versions ( #7343 )
...
* hardening: unify header validation across HTTP versions
This is meant to prevent request smuggling attacks over different HTTP versions.
* docs++, reject transfer-encoding for HTTP/1.0
* [autofix.ci] apply automated fixes
* tests++
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-24 22:45:13 +00:00
Maximilian Hils
03bf350924
improve next layer log message ( #7337 )
2024-11-23 02:42:06 +00:00
Sujal Singh
fd346055b7
Increase HTTP/2 default flow control window. ( #7317 )
...
* increase default flow control window
* fix tests
* fix test
* update changelog
* [autofix.ci] apply automated fixes
* simpler way to override default settings
* acknowledge settings
* document hyper-h2 workaround
* quote RFC
* [autofix.ci] apply automated fixes
* increase MAX_FRAME_SIZE
* update comment
* max out initial window size
* [autofix.ci] apply automated fixes
* increment connection control window
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-11-18 09:26:07 +00:00
8192bytes
bdeeb52911
Proper error handling for corrupted compressed body ( #7320 )
...
* Proper error handling for corrupted compressed body
* [autofix.ci] apply automated fixes
* Proper error handling for corrupted compressed body
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-14 17:03:26 +01:00
lukant
c10ff719f7
Fix interaction of modifyheaders addon with stream_large_bodies option ( #7286 )
...
* Fix interaction of modifyheaders addon with stream_large_bodies option
`modifyheaders` addon uses `request` and `response` hooks which, when
`stream_large_bodies` is enabled, are called after headers have already
been sent and can no longer be modified.
This commit changes `modifyheaders` addon to use
`requestheaders` and `responseheaders` hooks.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-31 22:08:17 +00:00
Maximilian Hils
69f455b962
Add tun proxy mode on Linux ( #7278 )
...
* simplify stream handling callback
* add `tun` proxy mode from mitmproxy_rs
* tun mode: tests++
* [autofix.ci] apply automated fixes
* bump mitmproxy_rs
* fix bugs
* ci: use macOS 13 for builds as 12 is being phased out
* test debugging
* bump mitmproxy_rs
* bump python version in ci, 3.13 is stable now
* nits
* is unshare to blame?
* how about this?
* coverage++
* [autofix.ci] apply automated fixes
* debüg
* debüüg
* debüüüg
* bump mitmproxy_rs
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-29 02:34:39 +05:30
Sujal Singh
ae882ffb00
Add support for starting a preconfigured Firefox instance via browser.start command. ( #7239 )
...
* add firefox linux support
* [autofix.ci] apply automated fixes
* fix nits
* add MacOS search path
* remove unnecessary import
support for version 3.9 and below was dropped
* fix tests
* coverage
* add windows search path
* changelog
* [autofix.ci] apply automated fixes
* handle case for invalid browser name
* remove socks and ftp
* remove popup
* reduce telemetry
* remove default bookmarks
* [autofix.ci] apply automated fixes
* reduce telemetry
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-19 12:45:51 +02:00
Maximilian Hils
93649e8baf
Set @SECLEVEL=0 if old TLS versions are requested ( #7241 )
...
* set `@SECLEVEL=0` if old TLS versions are requested
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-14 19:45:48 +02:00
Fata Nugraha
af88265f5c
Improve HTTP detection heuristic ( #7228 )
...
* Improve HTTP checking heuristic
* fix changelog
* Fix checking
* [autofix.ci] apply automated fixes
* simplify condition
---------
Co-authored-by: Fata Nugraha <fata.nugraha@grabtaxi.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-10-04 15:22:26 +00:00
Nicolai Søborg
a44191a9b1
Add --show-ignored-hosts ( #6720 )
...
* Add `--show-ignored-hosts`
Maybe a bit counterintuitive, but mitmproxy is very nice even without
the MITM part. When doing `--ignore-hosts '.*'` it is not possible to
see SNI's, so add new flag to show the raw TCP/UDP streams.
Fixes #6421
* Add tests for `--show-ignored-hosts`
* Changelog for `--show-ignored-hosts`
* [autofix.ci] apply automated fixes
* fixups
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-10-01 15:28:28 +00:00
Rūdolfs Bundulis
72a0448566
Propogate end_stream from downstream http/2 requests ( #7196 )
...
* Propogate end_stream from downstream http/2 requests
* [autofix.ci] apply automated fixes
* add test, simply patch
*) add test to check if end_stream is propogated on request / response
*) simplify the patch
* [autofix.ci] apply automated fixes
* fix linting in is_websocket
* adjust websocket test
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-09-30 18:49:25 +00:00
Matteo Luppi
e1ea491ad7
expose available web columns to Python ( #7205 )
...
* add script to generate all possible web columns
* remove test for now
* Make web_columns.py executable
* [autofix.ci] apply automated fixes
* add back tests
* [autofix.ci] apply automated fixes
* update changelog
* update changelog and add coauthor
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Abhishek-Bohora <abhishek.bohora16@gmail.com>
2024-09-22 19:21:41 +02:00
Maximilian Hils
badb2e52dd
ruff: make mitmproxy_rs first party ( #7203 )
2024-09-22 07:27:00 +02:00
Maximilian Hils
f8b742753b
Enable HTTP/3 in transparent mode by default ( #7202 )
...
* fixup raw quic handling
* enable HTTP/3 in transparent mode by default
* fix nits
2024-09-21 14:29:31 +00:00
Maximilian Hils
358fca3e72
tls_version: QUIC -> QUICv1 ( #7201 )
...
* tls_version: QUIC -> QUICv1
this aligns us with what OpenSSL is returning
* tests: add quic dumpfile
2024-09-21 16:22:09 +02:00
Maximilian Hils
8964deda8a
strip HTTPS records ALPN if http3 is disabled ( #7185 )
...
* strip HTTPS records ALPN if http3 is disabled
* Update strip_dns_https_records.py
* Update strip_dns_https_records.py
* [autofix.ci] apply automated fixes
* Update strip_dns_https_records.py
* [autofix.ci] apply automated fixes
* Update strip_dns_https_records.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-19 17:42:35 +00:00
Maximilian Hils
b53d2bd19a
Split mitmproxy.proxy.layers.quic into subpackages ( #7187 )
...
* individual coverage: skip logic-free __init__ files
* split quic layer into subpackages
this commit should not introduce any functional changes
2024-09-18 22:52:51 +05:30
Maximilian Hils
e7d1ad69b9
Individual coverage: skip logic-free __init__ files ( #7186 )
...
individual coverage: skip logic-free __init__ files
2024-09-18 22:37:12 +05:30