Commit Graph

2798 Commits

Author SHA1 Message Date
Maximilian Hils b4bf2f2282
parametrize dual stack test to ease debugging (#7099) 2024-08-13 22:35:18 +05:30
Gaurav Jain 46155cdee6
Handle fragmented QUIC client hello (#7067)
* Handle fragmented quic client hello

* [autofix.ci] apply automated fixes

* Add tests for fragmented client hellos

* Clear recv_buffer properly

* [autofix.ci] apply automated fixes

* Fixup

* Differentiate fragmented and invalid client hellos

* [autofix.ci] apply automated fixes

* Fix tests

* Add tests

* Fixup

* [autofix.ci] apply automated fixes

* Parametrize tests

* [autofix.ci] apply automated fixes

* Add suggested changes

* [autofix.ci] apply automated fixes

* lint

* style changes

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* add suggested changes

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-13 13:58:37 +02:00
Gaurav Jain 8a81214ff4
Add test to ensure that servers listen on IPv4 and IPv6 for default host (#7084)
* Update tunnelLayer docstrings

* Add tests for dual stack

* [autofix.ci] apply automated fixes

* Fixup

* Revert "Update tunnelLayer docstrings"

This reverts commit 56c6162646.

* Use existing code to check for ipv6

* [autofix.ci] apply automated fixes

* Cache no_ipv6

* [autofix.ci] apply automated fixes

* Update conftest.py

* Update conftest.py

* Bump mitmproxy_rs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-08-08 20:28:44 +05:30
Safa Safari 3544cf9b8e
support full alpha tcp connection (#7087)
* support full alpha tcp connection

* [autofix.ci] apply automated fixes

* Update mitmproxy/addons/next_layer.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update CHANGELOG.md

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update test/mitmproxy/addons/test_next_layer.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update test_next_layer.py

* Update next_layer.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-08-06 16:47:25 +00:00
Maximilian Hils aa73608ef6
Improve UX when users specify invalid certs (#7073)
* improve UX when users specify invalid certs

if we don't do this ourselves, OpenSSL will greet users with the ever-fascinating 'no shared ciphers' error during the first handshake.

* fixup test

* fix: include intermediate certs for QUIC

* [autofix.ci] apply automated fixes

* warn if `certs` has a certificate that's a CA

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-04 03:43:46 +05:30
Gaurav Jain b069347a26
Make `DnsResolver.resolver` and `DnsResolver.name_servers` as cached functions instead of cached properties (#7066)
* Use functool's cache instead of cache_property

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

* Fixup

* Fixup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-01 21:54:16 +02:00
dependabot[bot] f86b32fc7a
Update ruff requirement from <=0.5.0,>=0.5.0 to >=0.5.0,<=0.5.5 (#7058)
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.5.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 12:26:42 +00:00
Maximilian Hils 091399f811
Add experimental option for HTTP/3 in transparent mode (#7037)
* add experimental option for HTTP/3 in transparent mode

* fix test

* fix next layer selection for raw quic

* tests++

* remove leftover constant
2024-07-25 17:29:04 +05:30
Maximilian Hils 3beb3b21ff
Nextlayer: detect SSH as non-HTTP (#7041)
* nextlayer: detect SSH as non-HTTP

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-25 16:42:14 +05:30
Maximilian Hils 4f1bc6fc9a
Do not block local mode connections (#7036)
do not block local mode connections
2024-07-25 12:15:23 +02:00
Maximilian Hils 74424df839
Guard server_event against reentrancy, fix #7027 (#7031)
* guard server_event against reentrancy, fix #7027

* [autofix.ci] apply automated fixes

* attribution for excellent repros

* simplify test for compatibility with older Python versions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-23 14:42:09 +05:30
Gaurav Jain 317f5b9dce
Support all query types in DNS mode (#6975)
* Use mitmproxy_rust's getaddrinfo to resolve domain names

* Use mitmproxy.DnsResolver for A/AAAA queries and forward other queries to dns server

* [autofix.ci] apply automated fixes

* Add suggested changes

* [autofix.ci] apply automated fixes

* nits

* lazy-load resolver

* fix lookup of non A/AAAA records

* bump required mitmproxy_rs version

* [autofix.ci] apply automated fixes

* Add tests

* Update CHANGELOG

* [autofix.ci] apply automated fixes

* Fix tests

* [autofix.ci] apply automated fixes

* Fixup

* Fixup

* [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-07-16 17:31:11 +02:00
Denis Stanishevsky 9512e99819
Fix for loading HAR that contains BOM (#6897)
* Didn't work with the file from Fiddler, because of the BOM at the beginning of the file

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

* Added sample HAR with BOM as it comes from Fiddler

* Both HAR and JSON for it

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Denis Stanishevskiy <>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-07-16 15:44:49 +02:00
Pet Sneakers 71d7b3d6e7
Include Host header with CONNECT requests. Fixes #7019. (#7021)
* Include Host header with CONNECT requests. Fixes #7019.

* [autofix.ci] apply automated fixes

* Update CHANGELOG

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-16 15:43:11 +02:00
Gaurav Jain bbf5df326a
Fix decompressing fake pointers in DNS messages (#7022)
* Don't decompress fake pointers

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-13 16:18:03 +02:00
Matteo Luppi f77327634c
Sync consts backend-frontend (#7016)
* remove version from state and create new script to extract version

* fix lint

* [autofix.ci] apply automated fixes

* fix web/gen script to error on file permissions

* [autofix.ci] apply automated fixes

* add version to footer

* adjust tests

* [autofix.ci] apply automated fixes

* update changelog

* move version back into state

* [autofix.ci] apply automated fixes

* nits

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-07-11 09:54:22 +00:00
Maximilian Hils 04433e2c22
loosen cryptography warning (#7003) 2024-07-05 23:24:06 +00:00
Maximilian Hils 5353df5f1e
Incorporate existing SNI into allow/ignore decision, fix #5064 (#7002)
* incorporate existing SNI into allow/ignore decision, fix #5064

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 22:19:55 +00:00
Gaurav Jain 8d3906e531
Decompress domain names in ResourceRecord data (#6954)
* Parse compressed domain names in rr data

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

* Add comments

* Decompress only certain records

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* increase test coverage

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 03:19:19 +02:00
Jeremy Lainé c1e187c6e7
Fix QUIC version negotiation test (#6992)
To exercise incompatible version negotiation, we must not use version 0,
as this would cause the client's INITIAL packet to be erroneously
interpreted as a VERSION_NEGOTIATION packet - but with a corrupt format.

So far this has not caused any errors, because aioquic's
`pull_quic_header` did not fully parse VERSION_NEGOTIATION packets, but
this will change with the next aioquic version.

Use one of the reserved version numbers of the form 0x?a?a?a?a, as
defined in https://datatracker.ietf.org/doc/html/rfc9000#section-15
2024-07-02 11:34:37 +02:00
Gaurav Jain 7f7cb28d32
Add support for DNS over TCP (#6935)
* Parse DNS over TCP messages

* [autofix.ci] apply automated fixes

* Update _next_layer to detect DNS over TCP messages

* [autofix.ci] apply automated fixes

* Fixup

* allow query pipelining

* [autofix.ci] apply automated fixes

* Restructure pack/unpack mechanism and update tests

* Add tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Update next_layer test

* Add suggested changes

* [autofix.ci] apply automated fixes

* bump minimum hypothesis version

* bump hypothesis for good

* Update CHANGELOG.md

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-06-24 10:50:25 +00:00
Gaurav Jain 97ebc1fc18
Use existing API to unpack/pack domain names in HTTPS records (#6949)
* Use existing API to unpack/pack domain names in HTTPS records

* [autofix.ci] apply automated fixes

* tangentially related grammar fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-06-24 10:38:25 +00:00
jackfromeast 13e2209459
Fix issue #6944: Optimize response/request_body_buf by using list of byte chunks to avoid concatenation overhead (#6952)
* Fix the issue #6944: non-linear growth in processing time with mitmproxy regarding packet size. Replace the string (bytes) concatenation implementation of request_body_buf and response_body_buf to a list of chunk of bytes.

* Update the CHANGELOG.md regarding issue #6944

* [autofix.ci] apply automated fixes

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

* move receivebuffer into dedicated class

* [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-06-24 10:31:28 +00:00
Gaurav Jain 95bf441bc3
make DNS mode listen for both UDP and TCP (#6912)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-06-17 09:33:25 +02:00
Gaurav Jain be56a0af1f
Add `HttpConnectedHook` and `HttpConnectErrorHook` (#6930)
* Add HttpConnectedHook and HttpConnectErrorHook

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-06-15 00:02:54 +05:30
Andras Spitzer bde577aabc
fix zstd decompression (#6921)
* fix zstd decompression (issue #6914)

* add our fix to CHANGELOG

* add explicit read_across_frames=True + move zstd test to test_encoding.py

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-06-13 09:23:33 +00:00
Maximilian Hils 460789b7be
Autofix generated JS files and do not patch them in tests (#6910)
* autofix generated JS files and do not patch them in tests

* autofix: setup python

* [autofix.ci] apply automated fixes

* autofix: setup node

* add missing newline

* fixup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-06-12 01:25:46 +02:00
Gaurav Jain fa8b8998d7
Update strip_ech addon to use the new DNS HTTPS records API (#6905)
* Update and rename strip_ech addon to use new DNS HTTPS records API

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-06-09 20:26:26 +00:00
Gaurav Jain 03c8db88bb
Allow parsing of HTTPS record from DNS RDATA (#6884)
* Unpack HTTPS DNS record data

* Fix linting issues

* Add entry to CHANGELOG.md

* [autofix.ci] apply automated fixes

* Reorder functions

* [autofix.ci] apply automated fixes

* Rename private methods

* Use Enum to store constants

* Restructure constants

* Handle errors

* Use dataclasses to represent HTTPS records

* [autofix.ci] apply automated fixes

* Fix mypy errors

* [autofix.ci] apply automated fixes

* Allow packing of HTTPSRecords to its byte format

* Add tests for https_record

* [autofix.ci] apply automated fixes

* Rename https_record to https_records

* [autofix.ci] apply automated fixes

* Increase test coverage

* [autofix.ci] apply automated fixes

* Increase test coverage

* [autofix.ci] apply automated fixes

* Increase test coverage

* [autofix.ci] apply automated fixes

* Add comments

* Restructure HTTPS record API

* [autofix.ci] apply automated fixes

* Remove  from public API

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-06-09 19:56:21 +00:00
Gaurav Jain de871df53b
Add blockech addon (#6876)
* Add blockech addon

* Update CHANGELOG.md

* [autofix.ci] apply automated fixes

* Add tests

* [autofix.ci] apply automated fixes

* Fix tests

* Add suggested changes

* [autofix.ci] apply automated fixes

* rephrase changelog to be more user-centric

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-05-28 18:10:46 +02:00
Maximilian Hils 215dfea515
Skip proxyauth on client replay, fix #6836 (#6866)
* skip proxyauth on client replay, fix #6836

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-05-22 00:31:48 +00:00
Maximilian Hils b5574fb298
Fix program exit when `n` is passed (#6819)
* fix program exit when `n` is passed

fix #6818

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-24 14:14:54 +02:00
Maximilian Hils aedbde938a
tests: speedups, lowest-version, ... (#6812) 2024-04-21 23:44:09 +02:00
Maximilian Hils 3c1727d0d9 fix hypothesis being flaky 2024-04-17 12:51:20 +02:00
Maximilian Hils f997cd3a21
add `server_connect_error` hook (#6806)
* Add server connection error hook

* Add new hook to api-events doc

* Rename and add test

* Forgot to commit

* Small fix

* [autofix.ci] apply automated fixes

* fixed test_server.py

* fixed 'Import block is un-sorted or un-formatted'

* [autofix.ci] apply automated fixes

* test++, doc++

* add CHANGELOG entry

* [autofix.ci] apply automated fixes

* fix authors

* fix test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: haanhvu <haanh6594@gmail.com>
Co-authored-by: spacewasp <spacewasp1982@gmail.com>
2024-04-17 12:47:06 +02:00
Maximilian Hils bfbd777cbb
Fix certs for unicode domains (#6796)
* fix certs for unicode domains

fix #6729

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-12 17:22:19 +02:00
txrp0x9 1b44691d33
Fix saving of websocket flows (#6767)
* fix websocket message saving

* [autofix.ci] apply automated fixes

* added websocket as a supported format to export command, with tests for the same

* [autofix.ci] apply automated fixes

* added websocket message serialization in raw export, with test coverage

* [autofix.ci] apply automated fixes

* code suggestion fixes

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* [autofix.ci] apply automated fixes

* suggestion fixes

* fix merged code

* added tests for websocket export and cut.save

* [autofix.ci] apply automated fixes

* fix tests and add changes to changelog

* fix tests and add changes to changelog

* fix changelog

* fix changelog

* changelog addition

* changelog revert

* test fix

* [autofix.ci] apply automated fixes

* more test coverage

* [autofix.ci] apply automated fixes

* add changes to changelog

* add more test coverage

* [autofix.ci] apply automated fixes

* simplify

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-04-04 19:07:20 +00:00
winy ccf45a92e4
Add hex editor for non text files (#6768)
* add hex editor for non text files

* update changelog

* [autofix.ci] apply automated fixes

* fix failing text

* fix tests

* fix lint

* [autofix.ci] apply automated fixes

* Update test/mitmproxy/tools/console/test_master.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* Update test/mitmproxy/tools/console/test_master.py

Co-authored-by: Maximilian Hils <github@maximilianhils.com>

* a few changes

* fix tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-04-02 13:19:01 +02:00
Gaurav Jain 16a28bcd1f
Add primitive websocket interception and modification (#6766)
* Add primitive websocket interception and modification

* Update CHANGELOG.md

* Fix UI tab renaming on interception

* [autofix.ci] apply automated fixes

* Improve code readability

* [autofix.ci] apply automated fixes

* Improve code readability

* [autofix.ci] apply automated fixes

* Improve code readability

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-02 00:46:30 +02:00
Matteo Luppi f0dea82e8b
web: add comments (#6709)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-11 15:55:19 +01:00
pengqiseven a8603cac0d
fix some typos (#6728) 2024-03-11 08:19:36 +01:00
Daniel López Guimaraes ee5aac0a12
Fix Multipart content view parsing (#6653)
#### Description

On get_message_content_view, the content type wasn't including the
boundary, and was only setting the MIME type. This made the multipart
content view unusable, as the boundary was required on parsing. To fix
the issue, we assign the full content type instead.

This wasn't triggered by any previous tests because they would test
against the multipart parser directly, and not the generic parser.

#### Checklist

 - [X] I have updated tests where applicable.
 - [x] I have added an entry to the CHANGELOG.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-08 22:33:02 +01:00
Daniel López Guimaraes 7930759962
Update error check on test_load_script (#6726)
#### Description

This allows the "nonexistent" file error check to pass on systems that
don't use English as their primary language. With this, all mitmproxy
tests can pass on non-English machines.

Fixes #6723

#### Checklist

 - [X] I have updated tests where applicable.
 - [ ] I have added an entry to the CHANGELOG.
2024-03-08 22:30:17 +01:00
Maximilian Hils 0f7f0d0534
fix display of error messages on early shutdown (#6719)
fix #6707
fix #6716
2024-03-07 20:41:26 +00:00
dependabot[bot] a91989b7ba
Bump the github-actions group with 3 updates (#6701)
Bumps the github-actions group with 3 updates:
[install-pinned/ruff](https://github.com/install-pinned/ruff),
[apple-actions/import-codesign-certs](https://github.com/apple-actions/import-codesign-certs)
and
[docker/setup-buildx-action](https://github.com/docker/setup-buildx-action).

Updates `install-pinned/ruff` from
fe472defb50a6a2c00ea3a3982534e86e69991e8 to
38b373a3a8635c2be31d92314e816a491fda910a
<details>
<summary>Commits</summary>
<ul>
<li><a
href="38b373a3a8"><code>38b373a</code></a>
update README.md (ruff 0.3.0)</li>
<li><a
href="06af3ea1c3"><code>06af3ea</code></a>
update pins (ruff 0.3.0)</li>
<li><a
href="be1c354876"><code>be1c354</code></a>
update README.md (ruff 0.2.2)</li>
<li><a
href="c9779bbd5b"><code>c9779bb</code></a>
update pins (ruff 0.2.2)</li>
<li><a
href="48831a86ce"><code>48831a8</code></a>
update README.md (ruff 0.2.1)</li>
<li><a
href="6775b5f352"><code>6775b5f</code></a>
update pins (ruff 0.2.1)</li>
<li><a
href="bc12a64c2f"><code>bc12a64</code></a>
update README.md (ruff 0.2.0)</li>
<li><a
href="3b8cceff45"><code>3b8ccef</code></a>
update pins (ruff 0.2.0)</li>
<li>See full diff in <a
href="fe472defb5...38b373a3a8">compare
view</a></li>
</ul>
</details>
<br />

Updates `apple-actions/import-codesign-certs` from
5565bb656f60c98c8fc515f3444dd8db73545dc2 to
493007ed063995cf2d4fbca064704150548f8bb5
<details>
<summary>Commits</summary>
<ul>
<li><a
href="493007ed06"><code>493007e</code></a>
Merge pull request <a
href="https://redirect.github.com/apple-actions/import-codesign-certs/issues/62">#62</a>
from himself65/patch-1</li>
<li><a
href="2e5aa07267"><code>2e5aa07</code></a>
Update README.md</li>
<li>See full diff in <a
href="5565bb656f...493007ed06">compare
view</a></li>
</ul>
</details>
<br />

Updates `docker/setup-buildx-action` from 3.0.0 to 3.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/setup-buildx-action/releases">docker/setup-buildx-action's
releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<ul>
<li><code>cache-binary</code> input to enable/disable caching binary to
GHA cache backend by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/300">docker/setup-buildx-action#300</a></li>
<li>build(deps): bump <code>@​babel/traverse</code> from 7.17.3 to
7.23.2 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/282">docker/setup-buildx-action#282</a></li>
<li>build(deps): bump <code>@​docker/actions-toolkit</code> from 0.12.0
to 0.17.0 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/281">docker/setup-buildx-action#281</a>
<a
href="https://redirect.github.com/docker/setup-buildx-action/pull/284">docker/setup-buildx-action#284</a>
<a
href="https://redirect.github.com/docker/setup-buildx-action/pull/299">docker/setup-buildx-action#299</a></li>
<li>build(deps): bump uuid from 9.0.0 to 9.0.1 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/271">docker/setup-buildx-action#271</a></li>
<li>build(deps): bump undici from 5.26.3 to 5.28.3 in <a
href="https://redirect.github.com/docker/setup-buildx-action/pull/297">docker/setup-buildx-action#297</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.1.0">https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0d103c3126"><code>0d103c3</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/300">#300</a>
from crazy-max/cache-binary</li>
<li><a
href="f19477aacd"><code>f19477a</code></a>
chore: update generated content</li>
<li><a
href="a4180f835d"><code>a4180f8</code></a>
cache-binary input to enable/disable caching binary to GHA cache
backend</li>
<li><a
href="524315340d"><code>5243153</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/299">#299</a>
from docker/dependabot/npm_and_yarn/docker/actions-to...</li>
<li><a
href="3679a54023"><code>3679a54</code></a>
chore: update generated content</li>
<li><a
href="37a22a2fb2"><code>37a22a2</code></a>
build(deps): bump <code>@​docker/actions-toolkit</code> from 0.14.0 to
0.17.0</li>
<li><a
href="65afe610a1"><code>65afe61</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/297">#297</a>
from docker/dependabot/npm_and_yarn/undici-5.28.3</li>
<li><a
href="fcb8f722fd"><code>fcb8f72</code></a>
chore: update generated content</li>
<li><a
href="f62b9a17c0"><code>f62b9a1</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-buildx-action/issues/298">#298</a>
from crazy-max/bump-gha</li>
<li><a
href="74c5b717e5"><code>74c5b71</code></a>
bump codecov/codecov-action from 3 to 4</li>
<li>Additional commits viewable in <a
href="f95db51fdd...0d103c3126">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

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>
2024-03-06 21:54:11 +01:00
Denis Stanishevsky 766b5451b7
Allow --allow-hosts and --ignore-hosts to work together (#6711)
#### Description

The mutual exclusivity of the allow-hosts and ignore-hosts parameters
looks like an unnecessary obstacle and does not make much sense.

It is very convenient to use a proxy only for the domain of your
service, but at the same time ignore some subdomains, especially when
they serve some kind of CDNs with a large amount of data.

Although this filtering could be implemented using regexp with negative
lookahead, but it complicates configuration and is not as clear as
conjuction of allow and deny filters.

#### Checklist

 - [x] I have updated tests where applicable.
 - [x] I have added an entry to the CHANGELOG.

---------

Co-authored-by: Denis Stanishevskiy <>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-06 21:29:08 +01:00
Gaurav Jain b63a600f84
Allow runtime modifications of HTTP flow filters for server replays (#6695)
#### Description
Fixes #4506
`mitmproxy` during server-replay mode, calculates the hashes of flows
from input files based on user defined filters and uses them to compare
against hashes of incoming requests to serve the corresponding stored
response by matching the hash. However, during runtime, if the user
changes any of the filters, `mitmproxy` fails to recalculate the hashes
of input flows and hence doesn't return the intended response. This PR
fixes this issue by recomputing the hashes for every flow whenever a
filter(option) used for computing hashes is changed.

#### Checklist

 - [x] I have updated tests where applicable.
 - [x] I have added an entry to the CHANGELOG.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-02-28 18:57:06 +00:00
Gaurav Jain 92c556afbe
Add `content_view_lines_cutoff` option to mitmdump (#6692)
#### Description

Fixes #4476 
This PR adds the already existing `content_view_lines_cutoff` option to
`mitmdump` to filter the number of content lines shown when
`flow_detail` option is set to `3`. By default this option's value is
set to `512`

Updated tests that check for `cutoff` in responses that cross `512`
lines(with the default value set)
Added tests to ensure that custom values for `content_view_lines_cutoff`
works as intended

#### Verification
1. run `mitmdump --set flow_detail=3 --set content_view_lines_cutoff=3`
2. run `curl --proxy http:/127.0.0.1:8080 "https://google.com/"`

#### Before
<details>
<summary>Output</summary>

```
[15:00:41.441] HTTP(S) proxy listening at *:8080.
[15:00:53.236][127.0.0.1:38826] client connect
[15:00:53.520][127.0.0.1:38826] server connect google.com:443 (142.250.183.238:443)
127.0.0.1:38826: GET https://google.com/ HTTP/2.0
    user-agent: curl/8.5.0
    accept: */*

 << HTTP/2.0 301 Moved Permanently 220b
    location: https://www.google.com/
    content-type: text/html; charset=UTF-8
    content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-7rNdfc7B14cr_4JZskk3AQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
    date: Tue, 27 Feb 2024 09:31:02 GMT
    expires: Thu, 28 Mar 2024 09:31:02 GMT
    cache-control: public, max-age=2592000
    server: gws
    content-length: 220
    x-xss-protection: 0
    x-frame-options: SAMEORIGIN
    alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

    <HTML>
    <HEAD>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
      <TITLE>301 Moved</TITLE>
    </HEAD>
    <BODY>
      <H1>301 Moved</H1>
      The document has moved
      <A HREF="https://www.google.com/">here</A>
      .
    </BODY>
    </HTML>

[15:00:53.897][127.0.0.1:38826] client disconnect
[15:00:53.897][127.0.0.1:38826] server disconnect google.com:443 (142.250.183.238:443)
```
</details>

Content is not truncated within `3` lines

#### After

<details>
<summary>Output</summary>

```
[14:55:26.042] HTTP(S) proxy listening at *:8080.
[14:55:33.630][127.0.0.1:40554] client connect
[14:55:33.775][127.0.0.1:40554] server connect google.com:443 (142.250.182.142:443)
127.0.0.1:40554: GET https://google.com/ HTTP/2.0
    user-agent: curl/8.5.0
    accept: */*

 << HTTP/2.0 301 Moved Permanently 220b
    location: https://www.google.com/
    content-type: text/html; charset=UTF-8
    content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-LCd_ThPYwSImYoighASUFQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
    date: Tue, 27 Feb 2024 09:25:42 GMT
    expires: Thu, 28 Mar 2024 09:25:42 GMT
    cache-control: public, max-age=2592000
    server: gws
    content-length: 220
    x-xss-protection: 0
    x-frame-options: SAMEORIGIN
    alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

    <HTML>
    <HEAD>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
    (cut off)

[14:55:34.021][127.0.0.1:40554] client disconnect
[14:55:34.022][127.0.0.1:40554] server disconnect google.com:443 (142.250.182.142:443)
```
</details>

Content is truncated within `3` lines

#### Checklist

 - [x] I have updated tests where applicable.
 - [x] I have added an entry to the CHANGELOG.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-27 12:50:25 +01:00
Maximilian Hils fbc373bc9d
Make tests pass on older OpenSSL (#6665)
This re-adds some log messages adjusted in
2a82674fdc. We shouldn't fail tests for
this.

refs https://github.com/pyca/cryptography/pull/10391
2024-02-15 21:49:19 +00:00
Herman Ho 2a82674fdc
Fix error message in OpenSSL >=3.2.0 (#6658)
Fix the test cases for OpenSSL v3

Ref:

81b741f689
4030869d24
2024-02-13 16:28:00 +01:00