mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-21 22:58:24 +00:00
d9cac6fbcd
I noticed when running tests the output of `web/src/js/__tests__/ducks/_tflow.ts` would change depending on how I set my timezone, e.g. $ TZ=America/Los_Angeles pytest --quiet \ test/mitmproxy/tools/web/test_app.py >/dev/null \ && grep --extended-regexp 'not(after|before)' web/src/js/__tests__/ducks/_tflow.ts "notafter": 2235132207, "notbefore": 1604415807, $ TZ=Asia/Tokyo pytest --quiet \ test/mitmproxy/tools/web/test_app.py >/dev/null \ && grep --extended-regexp 'not(after|before)' web/src/js/__tests__/ducks/_tflow.ts "notafter": 2235074607, "notbefore": 1604354607 It looks like this is because the `cert_to_json` function simply calls `timestamp` the `datetime` object from `x509.Certificate.not_valid_before`, however, this `datetime` object is not timestamp aware, from the docs [1]: > A naïve datetime representing the beginning of the validity period for the certificate in UTC So when serializing to JSON, first convert the `datetime` to UTC then call `timestamp`. A test was added by inspecting one of the test certs with: $ openssl x509 -in test/mitmproxy/net/data/text_cert_2 -text Extracting the date and asserting on that. The corresponding test has also been re-run so that `_tflow.ts` was regenerated with it's correct value. Snapshots were also updated via: $(npm bin)/jest --updateSnapshot [1] https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate.not_valid_after |
||
---|---|---|
.github | ||
docs | ||
examples | ||
mitmproxy | ||
release | ||
test | ||
web | ||
.gitattributes | ||
.gitignore | ||
CHANGELOG.md | ||
codecov.yml | ||
CONTRIBUTING.md | ||
LICENSE | ||
MANIFEST.in | ||
README.md | ||
SECURITY.md | ||
setup.cfg | ||
setup.py | ||
tox.ini |
mitmproxy
mitmproxy
is an interactive, SSL/TLS-capable intercepting proxy with a console
interface for HTTP/1, HTTP/2, and WebSockets.
mitmdump
is the command-line version of mitmproxy. Think tcpdump for HTTP.
mitmweb
is a web-based interface for mitmproxy.
Installation
The installation instructions are here. If you want to install from source, see CONTRIBUTING.md.
Documentation & Help
General information, tutorials, and precompiled binaries can be found on the mitmproxy website.
The documentation for mitmproxy is available on our website:
If you have questions on how to use mitmproxy, please ask them on StackOverflow!
Contributing
As an open source project, mitmproxy welcomes contributions of all forms.
Also, please feel free to join our developer Slack!