mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
5af9df326a
This commit fixes netlib's optional (turned off by default) certificate verification, which previously did not validate the cert's host name. As it turns out, verifying the connection's host name on an intercepting proxy is not really straightforward - if we receive a connection in transparent mode without SNI, we have no clue which hosts the client intends to connect to. There are two basic approaches to solve this problem: 1. Exactly mirror the host names presented by the server in the spoofed certificate presented to the client. 2. Require the client to send the TLS Server Name Indication extension. While this does not work with older clients, we can validate the hostname on the proxy. Approach 1 is problematic in mitmproxy's use case, as we may want to deliberately divert connections without the client's knowledge. As a consequence, we opt for approach 2. While mitmproxy does now require a SNI value to be sent by the client if certificate verification is turned on, we retain our ability to present certificates to the client which are accepted with a maximum likelihood. |
||
---|---|---|
netlib | ||
test | ||
tools | ||
.appveyor.yml | ||
.coveragerc | ||
.env | ||
.gitignore | ||
.landscape.yml | ||
.travis.yml | ||
check_coding_style.sh | ||
LICENSE | ||
MANIFEST.in | ||
README.mkd | ||
requirements.txt | ||
setup.py |
Netlib is a collection of network utility classes, used by the pathod and mitmproxy projects. It differs from other projects in some fundamental respects, because both pathod and mitmproxy often need to violate standards. This means that protocols are implemented as small, well-contained and flexible functions, and are designed to allow misbehaviour when needed.
Requirements
Hacking
If you'd like to work on netlib, check out the instructions in mitmproxy's README.