Skip to content

Consider using the system SSL library, i.e., OpenSSL instead of rusttls / ring #11595

Open

Description

@marco-cloudflare

Summary

I thought that the native-tls flag would enable the native-ssl client but after close inspection, which is openssl in Linux, but, counter-intuitively, it actually just enables loading native certs using rustls and by extension ring, which has limitations e.g.: briansmith/ring#1631

See https://github.com/astral-sh/uv/blob/929e7c3ad96ff6b14aeb60527e6a4526ed24ec43/crates/uv-client/src/base_client.rs#L286C13-L286C59

This might the reason for problems like #9243

It seems that the reasoning behind this is for musl static compilation: #234 so I imagine that dynamic linking openssl is out of question. Another option could be enabling native-tls-vendored from reqwest which will static link openssl (it could be enabled only on musl builds, for others use native-tls) and have the uv's native-tls flag switch between reqwest use_rustls_tls() and use_native_tls()

Platform

Linux, but should affect any

Version

master branch

Python version

No response

Activity

  1. zanieb commented on Feb 18, 2025

    @zanieb
    Member

    I'm a little hesitant to call this a bug. It looks like more of a request to dynamically link OpenSSL to work around unimplemented features in Ring?

  2. marco-cloudflare commented on Feb 18, 2025

    @marco-cloudflare
    Author

    I'm a little hesitant to call this a bug. It looks like more of a request to dynamically link OpenSSL to work around unimplemented features in Ring?

    I guess you're right, the category and title could be better. Now looking at the documentation, it does say that "Whether to load TLS certificates from the platform's native certificate store" with no mention that it's/it's not the system's native ssl lib.

  3. added
    enhancementNew feature or improvement to existing functionality
    and removed
    bugSomething isn't working
    on Feb 18, 2025
  4. changed the title [-]Native-tls support is limited[/-] [+]Consider using the system SSL library, i.e., OpenSSL instead of `rusttls` / `ring`[/+] on Feb 18, 2025
  5. added
    compatibilityCompatibility with a specification or another tool
    on Feb 18, 2025
  6. added a commit that references this issue on Mar 23, 2026
  7. zanieb commented on Mar 24, 2026

    @zanieb
    Member

    In #18550 we've renamed the native-tls flag to system-certs for clarity, at least.

  8. tiran commented on Jul 27, 2026

    @tiran

    I found this ticket today when I was looking into PQC and crypto policy support for uv today.

    I ran an experiment to see what it would take to support OpenSSL via reqwest native-tls as an optional compile-time feature. It does not look that complicated, but it would come with a maintenance overhead. Disclaimer: my experiment https://github.com/tiran/uv/pull/new/native-tls-support is mostly AI generated. I spent a couple of extra rounds to make the code more appealing and included a plan document.

  9. zanieb commented on Jul 27, 2026

    @zanieb
    Member

    Thanks for exploring it! Yeah I think it'd be fairly easy to implement but I worry about the maintenance / support burden. I'm not sure we're seeing enough demand for it.

    What's your use-case?

  10. tiran commented on Jul 27, 2026

    @tiran

    Compliance and standardization :)

    Background: I'm part of a team at Red Hat that rebuilds Python wheels from sources for internal and external customers. We do this for multiple reasons, e.g. we want to have the sources for everything we deliver. Our wheels aren't manylinux wheels, too. Instead they are tight to system libraries and pre-installed RPMs -- like our system OpenSSL. We are providing container images for AI accelerator stacks like CUDA, ROCm, but also CPU. The images come with pre-configured pip and uv that install from our index instead of PyPI.

    I'm interested in a downstream rebuild of uv with OpenSSL, because we like to standardize on a few approved crypto libraries. All crypto libraries are configured through a crypto policy system. The policy is configured on the host system and automatically forwarded to containers by Podman. Since our wheel use OpenSSL from the OS, we can configure and update OpenSSL easily. For example our cryptography wheel is built with OPENSSL_NO_VENDOR to force system OpenSSL instead of vendored openssl-src.

  11. insanitybit commented on Aug 10, 2026

    @insanitybit

    Indeed, we have compliance obligations and want to standardize our OpenSSL configurations. It's really important for us to be able to run specific commands to say "we support these ciphers, we reject these" in order to satisfy audit requirements (and for our own sanity!). This is actually a blocker for our use of uv, even though we love it!

  12. tiran commented on Aug 10, 2026

    @tiran

    @insanitybit @zanieb I'm happy to turn my proof of concept into a proper PR. I'd need some assistance to figure out CI and Rust best practices, though. I'm a novice Rust developer.

    Paging @musicinmybrain. Ben is the package maintainer of uv for Fedora and EPEL. He might be interested in an uv build with system OpenSSL and Fedora crypto policy, too.

  13. michael-o commented on Aug 10, 2026

    @michael-o

    @yurivict This might be interesting for you as the downstream port maintainer in FreeBSD to avoid the pain in the ass I had with rustls/openssl-probe#43

  14. musicinmybrain commented on Aug 24, 2026

    @musicinmybrain
    Contributor

    Paging @musicinmybrain. Ben is the package maintainer of uv for Fedora and EPEL. He might be interested in an uv build with system OpenSSL and Fedora crypto policy, too.

    I would be quite interested in this.

    I’m not prepared to review nontrivial changes to the crypto support in uv, so I would want to see any proposed patch robustly reviewed before considering a downstream patch. Even then, I would be concerned about long-term maintenance of any nontrivial downstream patch, especially considering the fast pace of uv development and the consequences of making subtle errors in crypto code.

    I would much prefer to see support for using a system OpenSSL library merged and maintained in the official uv repository. At that point I would certainly start building Fedora’s uv with that option.

  15. konstin commented on Aug 24, 2026

    @konstin
    Member

    The main problem I expect are subtle behavior differences around custom cert support and error handling that would lead to setups passing with one uv distro and failing with another. Retry behavior with openssl would also be hard.

  16. added 4 commits that reference this issue on Sep 8, 2026
    11cd71d
    3dfbdff
    7c36eff
    289070a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityCompatibility with a specification or another toolenhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions