refactor: feature-switch for object_store CA certs#5030
refactor: feature-switch for object_store CA certs#5030crepererum wants to merge 1 commit intoapache:masterfrom
object_store CA certs#5030Conversation
304cfb0 to
bb9edbd
Compare
bb9edbd to
089f4cd
Compare
| not(feature = "tls-native-roots"), | ||
| not(feature = "tls-webpki-roots"), | ||
| ))] | ||
| compile_error!("Feature 'cloud' needs at a CA root feature, use either 'tls-native-roots' or 'tls-webpki-roots'."); |
There was a problem hiding this comment.
Technically you could silently ignore that and do not use any CA source (apart from the manual one). However this leads to runtime errors ("invalid cert") and is likely surprising to many users (esp. if they don't test any real cloud store in CI), so I've opted for forcing people to make a choice during compilation time.
|
I'm a little torn on this, I feel quite strongly that things should work out of the box without users having to understand the nuances of bundled vs system provided CA bundles... Is there any way we could use whatever the current default is, but provide a runtime mechanism to override this on ClientOptions or similar? |
|
I also seem to remember @roeap mentioning using openssl as an option with delta-rs, this may or may not be relevant here? |
|
If you wanna have a default, IMHO this should be "system" rather than "webpki" for the following reasons:
|
|
So to check my understanding is correct, currently we enable If you then add This PR is therefore only adding the ability to use feature flags to only use system roots. This feels like a less common requirement, but is definitely something we should permit. I wonder if as part of #5034 we could expose methods like use_preconfigured_tls. This would give downstreams full control of how they want to configure TLS should they so wish. Would this be sufficient?
I don't disagree, this was an oversight on my part I enabled |
correct.
correct.
not correct: this PR removes
You would still need to expose a "use system CAs" feature because w/o that system CAs aren't available at all. The reason is that using system CAs needs additional dependencies, see https://crates.io/crates/rustls-native-certs/. We could also bake-in both (webpki and system) and expose a switch, but that makes
With my prev. paragraph, I think we basically have the following options:
|
|
Having spoken with Marco, we've decided on an alternative path forward for this, so closing for now to save other reviewer's time |
Which issue does this PR close?
Closes #4870.
Rationale for this change
See issue.
What changes are included in this PR?
Feature switches, do NOT make any choice by default.
Are there any user-facing changes?
Breaking: Users now must choose their CA source.