Switch minreq TLS from webpki-roots to native certs (fixes #541)#542
Switch minreq TLS from webpki-roots to native certs (fixes #541)#542
Conversation
Change minreq feature from https-rustls to https-rustls-probe so that rustls loads certificates from the OS certificate store at runtime instead of using the compiled-in Mozilla root CA bundle. This allows users with self-hosted GitLab instances using custom/internal CA certificates to work correctly by installing their CA into the system trust store. Add unit tests for GitLab CI context (env var validation, MR deserialization) and integration tests verifying TLS native cert loading and HTTPS connectivity. Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
|
No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits. |
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
|
No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits. |
Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
|
That's a stunning speed of reaction and change suggestion @svarlamov! I'd also appreciate compiled executables available after the change is merged so that I could test those at my setup quickly. Thanks again. |
|
Hey @Mingela happy to help! I'll run a pre-release soon after this is merged so you can get binaries |
Switch minreq TLS to native OS certificate store (fixes #541)
Summary
Changes the
minreqfeature flag fromhttps-rustlstohttps-rustls-probeso that TLS connections use the OS certificate store (rustls-native-certs) instead of the compiled-in Mozilla root CA bundle (webpki-roots). This allows users running self-hosted GitLab with custom/internal CA certificates to usegit-ai ci gitlabby installing their CA into the system trust store.The one-line
Cargo.tomlchange affects allminreqHTTPS calls (GitLab CI API, main API client, Sentry, PostHog, JetBrains plugin downloads).Also adds unit tests for the GitLab CI module (MR JSON deserialization, template YAML) and an integration test verifying the native cert store can be loaded.
Updates since last revision
rustls-native-certsdev-dependency from0.6→0.8(latest)#[serial]tests (theunsafeset_var/remove_var tests)Review & Testing Checklist for Human
webpki-rootsis fully removed from the dep tree. In stripped Docker images (e.g.,FROM scratchor minimal Alpine withoutca-certificates), the bundled Mozilla roots were silently making things work. Withhttps-rustls-probe, if the OS cert store is empty, TLS connections will fail. Confirm this trade-off is acceptable for your user base.rustls-native-certsin lockfile: minreq internally pulls0.6.3(its own dependency); the dev-dep for tests is0.8.3. This is harmless (test-only) but worth being aware of.git-ai ci gitlab runagainst a self-hosted GitLab instance and confirm theUnknownIssuererror from Add an explicit configuration way to support custom TLS certificates #541 is resolved.Notes