Commit Graph

222 Commits

Author SHA1 Message Date
Maximilian Hils 0a3e016d39
fix a bug where connections would not be fully closed (#6543) 2023-12-12 18:15:19 +00:00
Zanie Blue 1fcd0335d5
Fix response `content-length` when reading from HAR files (#6548)
#### Description

Closes https://github.com/mitmproxy/mitmproxy/issues/6547

Responses in flows constructed from HAR files were using the
`Response.make` utility which resulted in the injection of
`content-length` headers. When a `content-length` header existed
already, this could cause failures during replay.

#### 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>
2023-12-12 17:24:29 +00:00
Maximilian Hils bda9c4ea3a
fix: log until the very end (#6541) 2023-12-09 19:53:33 +00:00
Fujun Lv 558b0b6642
Fix for --allow-hosts/--ignore-hosts options in WireGuard mode (#5930) (#6513) 2023-12-06 17:00:17 +07: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
Lucas Ficheux ba84b6be99
make scripts in config.yml relative to config.yml (#4860)
Co-authored-by: Lucas FICHEUX <lficheux@corp.free.fr>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-04 17:45:46 +07:00
Lucas Ficheux 43bbcefd1e
Parse set header cookies properly (#5084)
#### Description

Currently when an empty cookie attribute (`Secure`, `HttpOnly` ...) is
encountered while parsing a `Set-Cookie` header it will create a
`CookieAttrs` object containing a (key, value) pair with an empty string
for the attribute value ie:

```python
CookieAttrs[('Secure', ''), ('HttpOnly', ''), ('Path', '/')]
``` 
Resulting in an updated `Set-Cookie` header for the `Response` object
with invalid values for those empty attributes ie:
```python
(b'SetCookie', b'value=XYZ; Secure=; HttpOnly=; Path=/')
``` 
My browser (Firefox 95.0.1) does not pickup these attributes so the
cookie looses them.

______

This fix replaces the empty string attribute for empty cookie attributes
by the value `None` ie:

```python
CookieAttrs[('Secure', None), ('HttpOnly', None), ('Path', '/')]
``` 

So that they can be told apart from attributes with intentional empty
string values when setting the updated header, which results in a
properly formatted header:

```python
(b'SetCookie', b'value=XYZ; Secure; HttpOnly; Path=/')
``` 

#### Checklist

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

Co-authored-by: Lucas FICHEUX <lficheux@corp.free.fr>
2023-12-02 11:21:38 +07:00
Maximilian Hils 72679e5cf7
CHANGELOG: add a note that PR refs are added automatically (#6521) 2023-12-02 10:55:11 +07:00
mitmproxy release bot 18280927b4 mitmproxy 10.1.5 2023-11-14 12:54:48 +00:00
Maximilian Hils 50012418bc
Remove stray `replay-extra` (#6485)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-14 12:52:16 +00:00
mitmproxy release bot 11d758e151 mitmproxy 10.1.4 2023-11-13 14:11:21 +00:00
Maximilian Hils 3828373e91
macOS: Use correct entitlements for binary distribution (#6480)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-13 13:52:55 +01:00
Daniel Karandikar 746537e051
Add option to return various status codes rather than killing during server replay (#6465)
#### Description

Designed to satisfy the requirements of
https://github.com/mitmproxy/mitmproxy/issues/3489

Add `server_replay_404_extra` which behaves similarly to the kill flag,
but returns 404 responses rather than killing

#### 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>
2023-11-08 11:12:44 +01:00
lain3d 667a098002
Fix case that causes corrupt har files to be written (#6459)
#### Description

* Update savehar addon to fix creating corrupt har files caused by empty
response content

#### 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>
2023-11-06 07:31:28 -08:00
autofix-ci[bot] 506c0e1013
[autofix.ci] apply automated fixes 2023-11-04 15:16:32 +00:00
pogzyb 2a571a8c09
Update CHANGELOG.md 2023-11-04 11:13:09 -04:00
mitmproxy release bot 23bb301498 mitmproxy 10.1.3 2023-11-04 11:02:01 +00:00
Maximilian Hils e6f8f088d9
Strip double slash from websocket URL, fix #6452 (#6454)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-04 11:00:22 +00:00
mitmproxy release bot 4c07dc8488 mitmproxy 10.1.2 2023-11-03 11:57:58 +00:00
Maximilian Hils 3470473e4b
build macOS app bundle (#6447) 2023-11-03 11:21:55 +00:00
Maximilian Hils c637032af8
Declare Support for Python 3.12 (#6434) 2023-10-31 17:57:21 +00:00
Maximilian Hils 7f18545f3c
fix connection reuse with proxyauth (#6432) 2023-10-31 13:17:28 +00:00
outlaws-bai 640bb5377e
fix #6426 - Optimize LDAP Proxy Auth (#6428)
* fix #6426
https://github.com/mitmproxy/mitmproxy/issues/6426

* Revert "fix #6426"

This reverts commit 822b05b522.

* fix # 6426 Optimize LDAP Proxy Auth

* [autofix.ci] apply automated fixes

* update CHANGELOG.md

---------

Co-authored-by: jincong.bai <jincong.bai@zatech.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-10-31 12:52:21 +00:00
Teddy Xinyuan Chen 9f8b2e2a66
Fix path() docstring per #6345 (#6412)
* Fix path() docstring per #6345

* Update changelog

* Fix line too long linter error

* [autofix.ci] apply automated fixes

* nits: wording

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-10-19 21:27:22 +00:00
Dave T e98cf20b28
Make mitmweb use relative paths to connect to its resources. (#6411)
* Use relative paths in index.html

* Allow relative paths in websocket.tsx

* [autofix.ci] apply automated fixes

* Replace more root-relative URLs with relative URLs

* Add test for root relative URLs in index.html

* [autofix.ci] apply automated fixes

* Update changelog

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-10-19 14:10:26 -07:00
Mike Maxim c3d2a9dac4
fix certificates generated by dummy_cert on clients that require AuthorityKeyIdentifier (#6410)
* fix certificates generated by dummy_cert on clients that require AuthorityKeyIdentifier

* add changelog item
2023-10-18 19:32:47 +00:00
Maximilian Hils 2667ed44f5 add DNS-over-HTTPS contentview 2023-09-30 03:08:46 +02:00
Maximilian Hils d2136b66a0 add raw hex stream contentview 2023-09-30 03:08:46 +02:00
mitmproxy release bot b6ddf40f33 mitmproxy 10.1.1 2023-09-27 11:29:18 +00:00
Maximilian Hils e6e354cf38
web: don't crash when opening options (#6386) 2023-09-27 11:07:01 +00:00
Maximilian Hils c851a055c3
fix certificate generation for punycode domains, fix #6381 (#6382) 2023-09-24 17:55:21 +00:00
mitmproxy release bot 6ddcd9cb2a mitmproxy 10.1.0 2023-09-24 15:12:43 +00:00
Maximilian Hils e42edb474a update CHANGELOG 2023-09-24 17:01:28 +02:00
Maximilian Hils 9cad41cb9d bump mitmproxy_rs dependency, update CHANGELOG.md 2023-09-24 16:30:52 +02:00
Stanley Good bdcd3e3192
add save HAR addon (#6368)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-09-24 13:51:22 +00:00
TWY 37450173a1
mitmweb: Allow up to 4GB dump to be uploaded (#6373)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
2023-09-19 10:10:28 +00:00
Stanley Good b3272a3757
add har support in FlowReader class (#6335)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-09-18 21:05:29 +00:00
mitmproxy release bot 553f4501b2 mitmproxy 10.0.0 2023-08-04 09:37:11 +00:00
Maximilian Hils 890983bd02 update CHANGELOG.md 2023-08-03 15:50:25 +02:00
Arnaud Durand d3af57f13b
Enable unsafe legacy SSL renegotiation (#6281)
* Enable unsafe legacy renegotiation

* Update CHANGELOG

* Fix missing proxy_server_context argument in test

* use pyopenssl's OP_LEGACY_SERVER_CONNECT

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-07-29 16:39:25 +00:00
Pradyot Ranjan cb131b606f
Refactored use of server-replay-nopop to server-reply-pop (#6123)
* server-replay-nopop -> server-replay-pop

Co-authored-by: Pradyot Ranjan <99216956+prady0t@users.noreply.github.com>

* server-replay-pop -> server-replay-reuse

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-07-02 11:32:18 +00:00
Semnodime fd01a0aa95
Update http-reply-from-proxy.py (#6117)
* Update http-reply-from-proxy.py

Fix #6115

* Update CHANGELOG.md

Add one line to unreleased mitmproxy next

* Update CHANGELOG.md

Correct reference to PR

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-07-02 12:55:33 +02:00
Maximilian Hils 038512bada
Always include either SNI or target IP address as SAN (#6202)
* always include either SNI or target IP address as SAN

this unbreaks reverse proxy setups that are directly addressed by IP.

* [autofix.ci] apply automated fixes

* fix test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-06-26 02:35:50 +02:00
Tero Saaristo ac3af2afdb
grpc: enable decompressing zstd responses (#6188) 2023-06-24 10:59:58 +02:00
Mike-Ki-ASD 492f98d0d3
Support for selecting an elliptic curve for key exchange (#6170)
* Added option to specify an elliptic curve for key exchange between mitmproxy <-> server

* Description of changes

* Added link to pull request to CHANGELOG

* The
et/tls.py is now only dependend on their arguments and the option tls_ecdh_curve (renamed from curve) is now accessed in tlsconfig.py.

* nits

---------

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2023-06-14 10:08:20 +00:00
Maximilian Hils e0e46f453c
re-use SNI in reverse proxy mode if the original connection was torn down (#6148)
fix #6143
2023-05-28 16:35:34 +00:00
Sujal Singh 3675bedad8
Add escape key as another shortcut to exit current view. (#6087)
* add esc key binding

* make initialization of Keymap.keys more readable

* update changelog
2023-04-28 10:47:53 +02:00
Sujal Singh 33682c206e
Allow focus-follow shortcut to work in flow view context. (#6088)
* add follow new shortcut to flowview context

* update changelog

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-04-27 18:14:11 +02:00
Alex Gershberg 8f13293771
Add prettier to mitmweb (#5985)
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-03-12 17:50:15 +01:00
Maximilian Hils aa61f70b53 update CHANGELOG 2023-03-05 19:55:24 +01:00