Commit Graph

438 Commits

Author SHA1 Message Date
Patrick Martin
489dd77dbe
Remove Apple Silicon note (#7234)
Some checks failed
autofix.ci / autofix (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / filename-matching (push) Has been cancelled
CI / mypy (push) Has been cancelled
CI / individual-coverage (push) Has been cancelled
CI / test (macos-latest, 3.13-dev) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.13-dev) (push) Has been cancelled
CI / test (windows-latest, 3.13-dev) (push) Has been cancelled
CI / test-old-dependencies (push) Has been cancelled
CI / build (macos-12, macos-x86_64) (push) Has been cancelled
CI / build (macos-14, macos-arm64) (push) Has been cancelled
CI / build (ubuntu-20.04, linux) (push) Has been cancelled
CI / build (windows-2019, windows) (push) Has been cancelled
CI / build-wheel (push) Has been cancelled
CI / build-windows-installer (push) Has been cancelled
CI / test-web-ui (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / test-docker (push) Has been cancelled
CI / check (push) Has been cancelled
CI / deploy-docker (push) Has been cancelled
CI / deploy (push) Has been cancelled
2024-10-11 00:44:07 +02:00
Alexander Prinzhorn
ccb3ae5abe
Fix concepts-filters.md docs
Some checks failed
CI / test (macos-latest, 3.13-dev) (push) Waiting to run
CI / test (windows-latest, 3.13-dev) (push) Waiting to run
CI / build (macos-12, macos-x86_64) (push) Waiting to run
CI / build (macos-14, macos-arm64) (push) Waiting to run
CI / build (windows-2019, windows) (push) Waiting to run
CI / build-windows-installer (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / deploy-docker (push) Blocked by required conditions
CI / deploy (push) Blocked by required conditions
autofix.ci / autofix (push) Failing after 0s
CI / lint (push) Failing after 0s
CI / filename-matching (push) Failing after 0s
CI / mypy (push) Failing after 0s
CI / individual-coverage (push) Failing after 0s
CI / test (ubuntu-latest, 3.10) (push) Failing after 0s
CI / test (ubuntu-latest, 3.11) (push) Failing after 0s
CI / test (ubuntu-latest, 3.12) (push) Failing after 0s
CI / test (ubuntu-latest, 3.13-dev) (push) Failing after 0s
CI / test-old-dependencies (push) Failing after 0s
CI / build (ubuntu-20.04, linux) (push) Failing after 0s
CI / build-wheel (push) Failing after 0s
CI / test-docker (push) Has been skipped
CI / test-web-ui (push) Failing after 0s
CI / docs (push) Failing after 0s
2024-09-19 07:52:47 +00:00
Thomas Kriechbaumer
2c1802692d
options: add request_client_cert to enable mutual TLS (#7175)
Some checks failed
CI / test (macos-latest, 3.13-dev) (push) Waiting to run
CI / test (windows-latest, 3.13-dev) (push) Waiting to run
CI / build (macos-12, macos-x86_64) (push) Waiting to run
CI / build (macos-14, macos-arm64) (push) Waiting to run
CI / build (windows-2019, windows) (push) Waiting to run
CI / build-windows-installer (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / deploy-docker (push) Blocked by required conditions
CI / deploy (push) Blocked by required conditions
autofix.ci / autofix (push) Failing after 1s
CI / lint (push) Failing after 1s
CI / filename-matching (push) Failing after 1s
CI / mypy (push) Failing after 1s
CI / individual-coverage (push) Failing after 1s
CI / test (ubuntu-latest, 3.10) (push) Failing after 1s
CI / test (ubuntu-latest, 3.11) (push) Failing after 1s
CI / test (ubuntu-latest, 3.12) (push) Failing after 1s
CI / test (ubuntu-latest, 3.13-dev) (push) Failing after 1s
CI / test-old-dependencies (push) Failing after 1s
CI / build (ubuntu-20.04, linux) (push) Failing after 1s
CI / build-wheel (push) Failing after 1s
CI / test-docker (push) Has been skipped
CI / test-web-ui (push) Failing after 1s
CI / docs (push) Failing after 1s
* options: add request_client_cert to enable mutual TLS

This capability was already built-in but hard-coded to be disabled. Making it configurable as option (defaulting to off) enables mTLS connections between clients and mitmproxy. If true, mitmproxy will send a TLS `CertificateRequest` message to the client during the TLS handshake, upon which a client needs to present a client certificate to mitmproxy to successfully establish an mTLS connection.

This option can be used together with the `client_certs` option to also establish an mTLS connection between mitmproxy and the upstream server. In this case, mitmproxy needs to have a full client cert, including matching private key, that is trusted and accepted by the upstream server. This is a common scenario with MQTT or IoT connections.

Example usage:
$ mitmproxy --set request_client_cert=True --set client_certs=some_directory/

With `some_directory/` containing a `mqtt.example.com.pem` x509 certificate file (including private key).

This allows a client connecting using mTLS, to be intercepted by mitmproxy, which is itself establishing an mTLS connection to the `mqtt.example.com` upstream server. Restricting the client_certs using a directory and PEM files named after the upstream domain, narrows down the mTLS requirement to this single domain, while leaving all other traffic through mitmproxy untouched (normal TLS without client certs).

* add CHANGELOG entry

* docs++

* swap section order, re-add example

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2024-09-18 19:48:41 +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
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
Alessandro Surace
1a489f6a8c
docs: how to create the proper CA (#5370)
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2024-03-11 10:10:06 +00:00
Matteo Luppi
590eef0d44
fix docs (#6696)
#### Description

close #6682 

#### Checklist

 - [ ] I have updated tests where applicable.
 - [ ] I have added an entry to the CHANGELOG.
2024-02-28 23:04:45 +01:00
Ngoc Pham
4101e8aeef
docs: Rosetta is required on Apple Silicon (#6591) 2024-01-08 22:02:43 +00:00
Jon Brown
ae00e82c3a
remove mention of ctx.log from addon example (#6552)
[#5590](https://github.com/mitmproxy/mitmproxy/pull/5590) made the
switch to standard logging, but this part of the addons documentation
references the previous `ctx.log` approach.
2024-01-04 13:35:17 +00:00
Maximilian Hils
89189849c0
Remove Links to Slack Workspace (#6560)
We want to focus on GitHub Discussions going forward.
2023-12-19 12:20:43 +00:00
rosydawn6
81fc802194
Stream large bodies warn with modify body (#6514)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-12-05 02:36:54 +00:00
Maximilian Hils
f55ee1d44f
Migrate to ruff (#6433) 2023-10-31 16:03:53 +01:00
Maximilian Hils
afb308bc8a
docs: improve hooks overview (#6376) 2023-09-21 19:27:14 +00:00
Maximilian Hils
3b68e82db4
add android-unpinner (#6357) 2023-09-06 18:36:27 +00:00
Maximilian Hils
1a368e8dd2
docs: document reverse proxy schemes (#6296) 2023-08-03 16:09:07 +00:00
Feynman Liang
fe177ed421
Fix grammar in _index.md (#6266) 2023-07-19 17:12:34 +02:00
Maximilian Hils
36bac0da79
docs: add HTTP/3 to protocols page (#6207) 2023-06-25 23:09:58 +00:00
Thomas Bucaioni
90686abe82
Add example, according to issue #3752 (#6094)
* Add example, according to issue #3752

* Add list options

* Replace generic IPs

* Remove chars < and >

* Update docs/src/content/concepts-options.md

Perfect

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

---------

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2023-05-08 09:30:59 +00:00
Thomas Bucaioni
0ace627f6e
Update file howto-transparent.md as suggested in issue #4748 (#6091)
* Update file howto-transparent.md as suggested in issue #4748

* Update docs/src/content/howto-transparent.md

Absolutely

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

---------

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2023-04-29 12:58:38 +00:00
autofix-ci[bot]
51670861e6 [autofix.ci] apply automated fixes 2023-02-27 08:37:11 +01:00
Maximilian Hils
46bfb35488 drop support for Python 3.9 2023-02-27 08:37:11 +01:00
Jurrie Overgoor
7e3380e628
Add a section on using Magisk and Magisk modules in the Android howto (#5924)
* Add a section on using Magisk and Magisk modules in the Android howto

This allows you to use Google Play builds with mitmproxy.

* [autofix.ci] apply automated fixes

* Explain how to get the Magisk module from mitmweb

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-02-13 17:07:24 +01:00
Sujal Singh
4ebccfa236
add fedora certificate installation instructions (#5885) 2023-01-19 10:43:39 +01:00
autofix-ci[bot]
8c2428c9d3
[autofix.ci] apply automated fixes 2022-11-29 13:28:41 +00:00
Maximilian Hils
8361c81cdf add autofix.ci 2022-11-29 14:27:35 +01:00
Manuel Meitinger
f7bf1c44b6 Merge remote-tracking branch 'upstream/main' into quic 2022-11-23 22:14:03 +01:00
Mark Storus
8f845191f5
fix Wireshark TLS (Pre)-Master-Secret link (#5752) 2022-11-23 03:29:59 +01:00
Maximilian Hils
6b71066141 cleanup mitmproxy.connection, introduce dataclass-based serialization 2022-11-21 01:27:31 +01:00
Manuel Meitinger
3d39c52048 [quic] mode tests 2022-10-31 02:23:51 +01:00
Maximilian Hils
b6b54e4352 docs: update protocols 2022-10-26 18:50:09 +02:00
Maximilian Hils
720ea3fc16 docs: simplify example 2022-10-26 18:50:09 +02:00
stephenspol
c77decf054
Added Docs for Transparent Mode on Windows (#5672)
* Added docs for transparent mode on Windows

* Added changes to CHANGELOG.md

* Update CHANGELOG.md

* Update howto-transparent.md

Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2022-10-24 15:18:38 +00:00
Maximilian Hils
5f0d5bbe7f
docs: render markdown in notes (#5673) 2022-10-24 07:11:43 +00:00
Mazen Ramadan
5697b2e352
docs: Fix wrong option type (#5633) 2022-10-05 14:13:03 +02:00
Fabio Valentini
19afd8f9dd
docs: add documentation for wireguard mode (#5607) 2022-09-25 18:49:05 +02:00
Maximilian Hils
dc8ff24685 don't remove add_log but deprecate it. 2022-09-18 13:45:37 +02:00
Maximilian Hils
c69239bb90 switch to stdlib logging
mitmproxy previously used a homegrown logging mechanism based around
`mitmproxy.ctx.log` and the `add_log` hook. This worked well for everything
we control, but does not work outside the mitmproxy universe.
For now we have simply ignored logging in e.g. tornado or h2, but with the
upcoming introduction of mitmproxy_wireguard we now have a dependency
on some Rust/PyO3 code for which we definitely want logs, but which also
cannot easily be changed to use our homegrown logging (PyO3 does the heavy
lifting to add interoperability with stdlib logging). Long story short,
we want to introduce a log handler for stdlib logging.

Now there are two ways how such a handler could operate:

 1. We could build a handler that forwards all stdlib log events
    into our homegrown mechanism.
 2. We embrace stdlib's logging as the correct way to do things,
    and get rid of our homegrown stuff.

This PR follows the second approach by removing the `add_log` hook and
rewriting the `TermLog` and `EventStore` addons to listen for stdlib log records.
This means that all `mitmproxy.ctx.log.info` events are now simply `logging.info` etc.

One upside of this approach is that many parts of the codebase now don't depend
on the existence of `mitmproxy.ctx` and we can use off-the-shelf things like pytest's
`caplog`. We can also now better colorize log output and/or add timestamps.
2022-09-17 17:28:35 +02:00
Manuel Meitinger
891dae031c
Make default_port protocol specific. (#5563)
* [modes] make default_port protocol specific

* fix nits

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-09-07 12:14:48 +00:00
Manuel Meitinger
1706a9b9fe
Unify proxy modes, introduce UDP protocol detection. (#5556)
* [modes] new unified syntax

* [modes] full coverage udp.py

* [modes] mypy and coverage

* [modes] split mode_spec into two files

* [modes] adjust DNS layer

* [modes] add udp layer decision

* [modes] use 1:1 ServerInstances

* [modes] fix paste issue

* [modes] update tests

* [modes] fix typo

* [modes] updated docs

* [modes] fix typo
2022-08-30 05:27:51 +02:00
Manuel Meitinger
cd4a74fae7
Add support for raw UDP. (#5414) 2022-07-27 02:20:30 +02:00
Maximilian Hils
633130e208
add mode_specs docs, remove @classmethod @property usage (#5485)
`@classmethod @property` is deprecated in Python 3.11.
2022-07-25 14:16:12 +00:00
Maximilian Hils
02b982f000
windows install: document that installer is faster
refs #5375
2022-05-26 14:12:25 +02:00
Maximilian Hils
49c7f09a94 adjust to changes in pdoc 12 2022-05-15 19:16:36 +02:00
Maximilian Hils
b3587b52b2 make it black! 2022-04-28 19:11:10 +02:00
Maximilian Hils
fdde9ba3b3 use Python 3.9+ typing 2022-04-26 13:53:23 +02:00
Maximilian Hils
08b8310133 drop support for Python 3.8 2022-04-26 13:53:04 +02:00
Maximilian Hils
b31ad66225 autoflake --in-place **/*.py 2022-04-26 13:52:46 +02:00
Maximilian Hils
e83ec8390a pyupgrade --py39-plus **/*.py 2022-04-26 13:51:11 +02:00
Maximilian Hils
8d6a279818 add very basic DNS API docs
the rest still needs to be done, but this should serve as a template
2022-04-23 13:33:18 +02:00
Manuel Meitinger
7acc1b2590 Merge branch 'main' of https://github.com/mitmproxy/mitmproxy into dns 2022-04-09 04:03:23 +02:00