Trust the system certificate store for registries (corporate root CA, UnknownIssuer)

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
networking

Research direction

Start with crates/kiri-image/src/registry.rs and inspect how ureq and rustls configure trusted roots; then trace the update check and Kiri Share clients to see where the same verifier is used. Compare the proposed system verifier and additional CA file options, and check existing tests for registry TLS behavior. Done means corporate roots are trusted for registry pulls and login, with the intended behavior verified for the update check and Kiri Share.

Written by the indexing model from the issue text.

Description

enhancement
What you're trying to do

In a company network the image registry (Artifactory) has a certificate issued by the company's own root CA. macOS trusts that root (it's in the System keychain), so browsers, curl and Podman work. With Kiri 0.2.1 (macOS 27.0.1, Apple silicon):

$ docker --context kiri pull registry.corp.example/postgres:17
network error: io: invalid peer certificate: UnknownIssuer

docker login to the same registry fails the same way, and so does Kiri's own update check (update check failed error="io: invalid peer certificate: UnknownIssuer").

The registry client is ureq + rustls with roots from webpki-roots (crates/kiri-image/src/registry.rs); Cargo.lock has no rustls-native-certs or rustls-platform-verifier. There's no setting or file for an extra CA, and the standard variables are ignored:

$ SSL_CERT_FILE=corp-root.pem SSL_CERT_DIR=. kiri raw pull registry.corp.example/postgres:17
kiri: network error: io: invalid peer certificate: UnknownIssuer

Putting the CA into the VM doesn't help, because pulls are made by kiri daemon on the Mac. Today the only way is podman pull … && podman save … | docker --context kiri load.

What you'd like Kiri to do

Any of these would cover it:

  1. Verify with rustls-platform-verifier (macOS keychain, Windows store, /etc/ssl on Linux), keeping webpki-roots as a fallback.
  2. Load extra roots from a file Kiri owns, e.g. ~/.kiri/certs/*.pem, and from SSL_CERT_FILE.
  3. A Settings → Network toggle: "Trust certificates from the system".

The same verifier would help the update check and Kiri Share too.

Would you like to build it?

No, just suggesting it

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
7h 48m
Merged PRs (30d)
105

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.