diff --git a/Cargo.lock b/Cargo.lock index 863b51d4..7a8847ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1052,6 +1052,20 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -1910,6 +1924,7 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -1919,11 +1934,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -1931,6 +1949,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", "winreg", ] @@ -1947,6 +1966,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rip" version = "0.1.0" @@ -2017,6 +2051,37 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.15" @@ -2047,6 +2112,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.9.2" @@ -2230,6 +2305,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2472,6 +2553,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.9" @@ -2600,6 +2691,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.4.1" @@ -2750,6 +2847,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "winapi" version = "0.3.9" diff --git a/crates/index/Cargo.toml b/crates/index/Cargo.toml index 359c578a..3eab6855 100644 --- a/crates/index/Cargo.toml +++ b/crates/index/Cargo.toml @@ -10,6 +10,11 @@ edition.workspace = true readme.workspace = true rust-version.workspace = true +[features] +default = ["native-tls"] +native-tls = ['rattler_installs_packages/native-tls', 'rip/native-tls'] +rustls-tls = ['rattler_installs_packages/rustls-tls', 'rip/rustls-tls'] + [dependencies] clap = { version = "4.4.5", features = ["derive"] } dirs = "5.0.1" @@ -17,8 +22,8 @@ indexmap = "2.0.0" indicatif = "0.17.7" miette = { version = "5.10.0", features = ["fancy"] } rand = "0.8.5" -rattler_installs_packages = { path = "../rattler_installs_packages" } -rip = { path = "../rip" } +rattler_installs_packages = { path = "../rattler_installs_packages", default-features = false } +rip = { path = "../rip", default-features = false } rusqlite = { version = "0.29.0", features = ["bundled"] } serde_json = "1.0.107" tokio = { version = "1.32.0", features = ["rt", "macros", "rt-multi-thread"] } diff --git a/crates/rip/Cargo.toml b/crates/rip/Cargo.toml index fca16c5d..f76e2614 100644 --- a/crates/rip/Cargo.toml +++ b/crates/rip/Cargo.toml @@ -11,6 +11,11 @@ license.workspace = true readme.workspace = true default-run = "rip" +[features] +default = ["native-tls"] +native-tls = ['reqwest/native-tls', 'rattler_installs_packages/native-tls'] +rustls-tls = ['reqwest/rustls-tls', 'rattler_installs_packages/rustls-tls'] + [dependencies] clap = { version = "4.4.5", features = ["derive"] } console = { version = "0.15.7", features = ["windows-console-colors"] } @@ -20,8 +25,8 @@ indicatif = "0.17.7" itertools = "0.11.0" miette = { version = "5.10.0", features = ["fancy"] } rand = "0.8.5" -rattler_installs_packages = { path = "../rattler_installs_packages" } -reqwest = "0.11.20" +rattler_installs_packages = { path = "../rattler_installs_packages", default-features = false } +reqwest = { version = "0.11.20", default-features = false } resolvo = "0.1.0" rusqlite = { version = "0.29.0", features = ["bundled"] } serde = "1.0.188"