Skip to content

UV --native-tls not respecting system certs on RHEL8 #12902

Description

@TheFriendlyCoder

Summary

In a clean base image / docker image running RHEL8 (ubi in my case), some tools don't seem to "play nice" with the system certs when run under uv. One being the mkdocstrings plugin for mkdocs. When it tries to reach out to a public repo to gather Python doc inv files (ie: https://docs.python.org/3/objects.inv) it fails with an SSL certificate failure. Setting the SSL_CERT_FILE env var to the default path of the system cert bundle (ie: /etc/pki/tls/certs/ca-bundle.crt) works as expected, but passing the --native-tls flag to uv does not.

I'm not sure if you have access to "ubi" base images or not, but the steps to reproduce look something like this:

  1. Run docker run -it icr.io/appcafe/ibm-semeru-runtimes:open-17-jdk-ubi /bin/bash (mounting a sample workspace into the container if needed)
  2. Run uv run mkdocs build --strict - build fails
  3. Run uv run --native-tls mkdocs build --strict - build fails
  4. Run SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt uv run mkdocs build --strict - build succeeds

The sample project I'm working on has some dependencies like this:

dev = [
    "mkdocs",
    "mkdocs-material",
    "mkdocstrings[python]"
]

and an mkdocs.yml file that looks something like this:

site_name: "fubar"

theme:
  name: material

plugins:
- mkdocstrings:
    default_handler: python
    handlers:
      python:
        import:
          - https://docs.python.org/3/objects.inv

The exact error produced is:

ERROR   -  mkdocstrings: Couldn't load inventory https://docs.python.org/3/objects.inv through handler 'python': <urlopen error [SSL:
           CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

Platform

RHEL8

Version

uv 0.6.14

Python version

Python 3.10.16, Python 3.9.18

Metadata

Metadata

Assignees

Labels

questionAsking for clarification or support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions