uv/docs
Charlie Marsh d86075fc1e
Add support for --trusted-host (#6591)
## Summary

This PR revives https://github.com/astral-sh/uv/pull/4944, which I think
was a good start towards adding `--trusted-host`. Last night, I tried to
add `--trusted-host` with a custom verifier, but we had to vendor a lot
of `reqwest` code and I eventually hit some private APIs. I'm not
confident that I can implement it correctly with that mechanism, and
since this is security, correctness is the priority.

So, instead, we now use two clients and multiplex between them.

Closes https://github.com/astral-sh/uv/issues/1339.

## Test Plan

Created self-signed certificate, and ran `python3 -m http.server --bind
127.0.0.1 4443 --directory . --certfile cert.pem --keyfile key.pem` from
the packse index directory.

Verified that `cargo run pip install
transitive-yanked-and-unyanked-dependency-a-0abad3b6 --index-url
https://127.0.0.1:8443/simple-html` failed with:

```
error: Request failed after 3 retries
  Caused by: error sending request for url (https://127.0.0.1:8443/simple-html/transitive-yanked-and-unyanked-dependency-a-0abad3b6/)
  Caused by: client error (Connect)
  Caused by: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity))
```

Verified that `cargo run pip install
transitive-yanked-and-unyanked-dependency-a-0abad3b6 --index-url
'https://127.0.0.1:8443/simple-html' --trusted-host '127.0.0.1:8443'`
failed with the expected error (invalid resolution) and made valid
requests.

Verified that `cargo run pip install
transitive-yanked-and-unyanked-dependency-a-0abad3b6 --index-url
'https://127.0.0.1:8443/simple-html' --trusted-host '127.0.0.2' -n` also
failed.
2024-08-27 09:36:50 -04:00
..
.overrides/partials/integrations/analytics Migrate from MdBook to MkDocs (#5062) 2024-07-15 22:22:07 +00:00
assets docs: add uv run docs for gui scripts (#6478) 2024-08-22 19:44:37 -05:00
concepts Fix docs for disabling build isolation with uv sync (#6674) 2024-08-27 08:49:59 -04:00
configuration Add support for --trusted-host (#6591) 2024-08-27 09:36:50 -04:00
getting-started docs: use python to highlight requirements and use more content tabs (#6549) 2024-08-27 06:05:14 -05:00
guides Add development section to Docker guide and reference new example project (#6666) 2024-08-27 06:41:44 -05:00
js Improve copy of console command examples (#5397) 2024-07-31 14:52:02 +00:00
pip docs: use python to highlight requirements and use more content tabs (#6549) 2024-08-27 06:05:14 -05:00
reference Add support for --trusted-host (#6591) 2024-08-27 09:36:50 -04:00
stylesheets Increase the size of nav entries (#6233) 2024-08-20 11:22:29 -05:00
.gitignore Add structured documentation (#4426) 2024-06-26 11:28:42 -05:00
index.md docs: use python to highlight requirements and use more content tabs (#6549) 2024-08-27 06:05:14 -05:00
requirements-insiders.in Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements-insiders.txt Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements.in Migrate from MdBook to MkDocs (#5062) 2024-07-15 22:22:07 +00:00
requirements.txt Migrate from MdBook to MkDocs (#5062) 2024-07-15 22:22:07 +00:00