Skip to content
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

Configure TLS at runtime #384

Open
niklasmohrin opened this issue Oct 19, 2024 · 3 comments · May be fixed by #386
Open

Configure TLS at runtime #384

niklasmohrin opened this issue Oct 19, 2024 · 3 comments · May be fixed by #386

Comments

@niklasmohrin
Copy link
Collaborator

We keep running into problems where one TLS configuration or another breaks (see #244, #328, #330). We then usually have to tell people to try compiling with another compile feature.

The library reqwests, which is used for making the requests, can be configured at runtime: https://docs.rs/reqwest/0.12.8/reqwest/struct.ClientBuilder.html#method.tls_built_in_root_certs

It should be possible to use these methods, so that we can tell users to change configuration options instead of recompiling. We will still keep the features, so that smaller binaries can be created. However, I think our default feature-set should be to enable all options.

To get going, we only need support in the config file, not via CLI flags or environment variables. The option should be in the updates section. I am not settled on any particular name for the option, but something like "tls-backend" or so should work to get started. (It is possible that it will turn out nicer with two options). We will figure out the specifics once we have some code to talk about.

@erickguan erickguan linked a pull request Oct 27, 2024 that will close this issue
@dbrgn
Copy link
Collaborator

dbrgn commented Nov 7, 2024

I'd wanted to suggest to simply use native roots by default. However, I searched for old PRs and realized that we switched to WebPKI roots due to issues on macOS: #272

I don't mind either option, the config file is probably a good idea. On the bikeshedding side, I think I'd prefer tls-roots instead of backend, but either one would be fine for me.

@niklasmohrin
Copy link
Collaborator Author

I think I'd prefer tls-roots instead of backend, but either one would be fine for me.

I was wondering what a good name would be, but as https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.use_native_tls reads "Force using the native TLS backend." I thought that "roots" does not quite capture the scope of all options. What do you think?

@dbrgn
Copy link
Collaborator

dbrgn commented Nov 9, 2024

Ah, fair point.

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

Successfully merging a pull request may close this issue.

2 participants