From b59341f7c1aee53417417833d5ca45d9631457f7 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Thu, 2 Nov 2023 16:04:00 +0100 Subject: [PATCH] refactor: feature-switch for `object_store` CA certs Closes #4870. --- object_store/Cargo.toml | 4 +++- object_store/src/lib.rs | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/object_store/Cargo.toml b/object_store/Cargo.toml index 7fcb6ce9e3f1..53d5955aa0ee 100644 --- a/object_store/Cargo.toml +++ b/object_store/Cargo.toml @@ -50,7 +50,7 @@ quick-xml = { version = "0.31.0", features = ["serialize", "overlapped-lists"], serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } serde_json = { version = "1.0", default-features = false, optional = true } rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true } -reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"], optional = true } +reqwest = { version = "0.11", default-features = false, features = ["rustls-tls-manual-roots"], optional = true } ring = { version = "0.17", default-features = false, features = ["std"], optional = true } rustls-pemfile = { version = "1.0", default-features = false, optional = true } tokio = { version = "1.25.0", features = ["sync", "macros", "rt", "time", "io-util"] } @@ -64,6 +64,8 @@ azure = ["cloud"] gcp = ["cloud", "rustls-pemfile"] aws = ["cloud"] http = ["cloud"] +tls-native-roots = ["reqwest?/rustls-tls-native-roots"] +tls-webpki-roots = ["reqwest?/rustls-tls-webpki-roots"] [dev-dependencies] # In alphabetical order tempfile = "3.1.0" diff --git a/object_store/src/lib.rs b/object_store/src/lib.rs index cdd572dd9b3a..a51b9349d7bf 100644 --- a/object_store/src/lib.rs +++ b/object_store/src/lib.rs @@ -86,6 +86,13 @@ doc = "* [`http`]: [HTTP/WebDAV Storage](https://datatracker.ietf.org/doc/html/rfc2518). See [`HttpBuilder`](http::HttpBuilder)" )] //! +//! Stores that use HTTPS/TLS (this is true for most cloud stores) can use the source of their [CA] +//! certificates. This is controlled by a feature switch: +//! +//! - `tls-native-roots`: use certificates bundled with the operating system, see [`rustls-native-certs`] +//! - `tls-webpki-roots`: use Mozilla's root certificates bundled with the library/application, see +//! [`webpki-roots`] +//! //! # Why not a Filesystem Interface? //! //! Whilst this crate does provide a [`BufReader`], the [`ObjectStore`] interface mirrors the APIs @@ -434,7 +441,10 @@ //! //! [Optimistic Concurrency Control]: https://en.wikipedia.org/wiki/Optimistic_concurrency_control //! [Apache Iceberg]: https://iceberg.apache.org/ +//! [CA]: https://en.wikipedia.org/wiki/Certificate_authority //! [Delta Lake]: https://delta.io/ +//! [`rustls-native-certs`]: https://crates.io/crates/rustls-native-certs/ +//! [`webpki-roots`]: https://crates.io/crates/webpki-roots //! #[cfg(all(