-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
libstore/filetransfer: add support for MTLS authentication #13030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@vlaci added a regression test. Please check. |
Have a look later at the test... Only tested without nix-build. |
There is no openssl and python in the test derivation. I am not familiar with Nix's test suite. Should there be an additional layer of indirection using i.e nix-shell shebang or nix-run inside the test script? |
For the sake of moving this forward, I've just added to required |
I'm not clear about the implications of:
Otherwise, this looks good. |
My understanding that it is done that way to ensure that the cert is used only if the request will go to Also, the CI test timing out is not a fluke: the same full test run gets stuck locally as well. I am yet to figure out why and where, as the newly added test seemingly runs to completion. |
Those are set via the store's URI, e.g.: https://substituter.invalid?ssl-cert=/path/to/cert.pem&ssl-key=/path/to/key.pem
This happens in GitHub's MacOS runners
Right. Note that the conditions under which It seems prudent not to indiscriminately apply the configured certificates to other hosts.
I don't know under which circumstances |
This is a collection of Lix plugins that showcase how to write one for various usecases. The first is a mTLS store plugin that enable mTLS cache URIs (`https+mtls://`). We enable meson build system support for this plugin but we are not going to distribute it in the official packaging of Lix, we will repackage each relevant plugin downstream in Nixpkgs. These plugins have *NO* guarantee support, they are provided as useful references and are possibly production-ready if your usecase is simple enough. Reference: NixOS/nix#13030 (this change has resemblances but our APIs are different, the tests harness is mostly from CppNix). Change-Id: Ib354271981b35dff6c134b12c4748c3eaf743fcb Co-authored-by: Jörg Thalheim <[email protected]> Co-authored-by: László Vaskó <[email protected]> Signed-off-by: Raito Bezarius <[email protected]>
Certificate/private-key pair can be configured globally and it will be handled by libcurl.
Motivation
In our setup, we use client certificate authentication extensively to access company resources. It would be very easy for us to deploy a binary cache and setup authentication the same way.
Context
Fixes #13002
Questions
Is it okay to support only one certificate globally?I've gone with that as I don't think, that many people use different certificates for different HTTPS services, and implementing per-domain certificate handling would greatly complicate the implementation
It can be now configured per substituter
I've added the settings to globals, as netrc and CA verification settings are already there. IDK if that is the right place.Settings are now substituter specific
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.