Skip to content

fix(seed): support CA directories, tilde paths, and client certs in index lookups - #3793

Open
TranHoaiPhu wants to merge 3 commits into
pypa:mainfrom
TranHoaiPhu:fix/index-cert-directory-and-client-cert
Open

TranHoaiPhu wants to merge 3 commits into
pypa:mainfrom
TranHoaiPhu:fix/index-cert-directory-and-client-cert

Conversation

@TranHoaiPhu

@TranHoaiPhu TranHoaiPhu commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

🐛 The lookup that checks pip's index for yanked releases now reads pip's TLS settings the way pip does:

  • cert (or PIP_CERT) may name a directory of CA certificates, such as /etc/ssl/certs. It was always passed as cafile=, which fails on a directory.
  • cert and client-cert expand a leading ~, as pip's path options do.
  • client-cert (or PIP_CLIENT_CERT) is now loaded, so indexes that require a client certificate work. An encrypted key fails at once instead of waiting for a passphrase on stdin.

The paths come from pip's configuration files and PIP_* variables and are only handed to ssl. A missing, invalid or encrypted file raises OSError, and the lookup reports the yank status as unknown, as it already does for other unreadable indexes.

Checklist

  • ran the linter to address style issues (ruff, flake8-lazy, simplint, codespell, docstrfmt, ty)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added a docs/changelog/+index-cert-dir-and-client-cert.bugfix.rst fragment
  • updated/extended the documentation (N/A)
  • explained which outside inputs are handled and how they are kept safe from code execution
  • ran tests on Python 3.10 and 3.15 (verified locally on Python 3.12; awaiting CI matrix)
  • linked upstream issues beside any temporary interpreter overrides (N/A)
  • kept the PR in draft until CI passes

@TranHoaiPhu
TranHoaiPhu marked this pull request as ready for review December 5, 2026 13:50
The three new tests repeated the same setup, and the plain certificate
directory case duplicated the tilde one; one parametrized test covers a
CA directory, a CA file, a client certificate and both together.
@gaborbernat gaborbernat added the bug label Dec 5, 2026

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants