Skip to content

Use the system trust store for HTTPS requests - #1512

Merged
BurntSushi merged 1 commit into
mainfrom
zb/certs
Feb 16, 2024
Merged

BurntSushi merged 1 commit into
mainfrom
zb/certs

Conversation

@zanieb

@zanieb zanieb commented Feb 16, 2024 •

Copy link
Copy Markdown
Member

Closes #1474

Using the rustls-tls-native-roots feature

rustls-tls: Enables TLS functionality provided by rustls. Equivalent to rustls-tls-webpki-roots.

rustls-tls-webpki-roots: Enables TLS functionality provided by rustls, while using root certificates from the webpki-roots crate.

rustls-tls-native-roots: Enables TLS functionality provided by rustls, while using root certificates from the rustls-native-certs crate.

Additional context:

Prior discussion at #609

@zanieb zanieb added enhancement New feature or improvement to existing functionality area:registry Related to package indexes and registries labels Feb 16, 2024
@zanieb
zanieb marked this pull request as ready for review February 16, 2024 16:52
@zanieb

zanieb commented Feb 16, 2024

Copy link
Copy Markdown
Member Author

The major downsides are:

  • The OS update system may, in fact, be quite poor at keeping the root certificates up-to-date if it is disabled or out-of-support.
  • The quality of the ca-certificates package on debian-based Linux distributions is poor. At the time of writing, this ships many certificates not included in the Mozilla set, either because they failed an audit and were withdrawn or were removed for mississuance.

@BurntSushi BurntSushi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to me. In particular, it seems like this is the recommended approach from rustls.

@BurntSushi
BurntSushi merged commit 9737b93 into main Feb 16, 2024
@BurntSushi
BurntSushi deleted the zb/certs branch February 16, 2024 19:07
@notatallshaw

Copy link
Copy Markdown
Collaborator

FYI, Pip is moving to this model via truststore: https://pip.pypa.io/en/stable/topics/https-certificates/

My experience is it is massively helpful in large organization environments.

charliermarsh pushed a commit that referenced this pull request Feb 23, 2024
I'm confused that we have this separate specification of `reqwests`? I'm
not sure this has any effect, but it seems like it should be done for
correctness.

Follows #1512
@carlosjourdan

carlosjourdan commented Feb 27, 2024 •

Copy link
Copy Markdown

Corporate network with ssl inspection firewall, custom ca on every site. Root certificate is trusted by windows, and environment variables REQUESTS_CA_BUNDLE and SSL_CERT_FILE are setup. Python requests work fine. Pip install as well. uv fails with error below.

error: error sending request for url (https://pypi.org/simple/zeep/): error trying to connect: invalid peer certificate: UnknownIssuer
  Caused by: error trying to connect: invalid peer certificate: UnknownIssuer
  Caused by: invalid peer certificate: UnknownIssuer

@zanieb

zanieb commented Feb 27, 2024

Copy link
Copy Markdown
Member Author

Hi @carlosjourdan would you mind opening a new issue?

@carlosjourdan

Copy link
Copy Markdown

Just did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:registry Related to package indexes and registries enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to run uv behind a corporate proxy?

4 participants