From 62db190cbadc167786b056ddd7312233f197a00c Mon Sep 17 00:00:00 2001 From: o-tsaruk Date: Thu, 19 Oct 2023 15:43:27 +0300 Subject: [PATCH] Use rustls instead of OpenSSL --- Cargo.lock | 100 ++++++------------------------------ crates/db/Cargo.toml | 2 +- crates/migration/Cargo.toml | 2 +- 3 files changed, 17 insertions(+), 87 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd2cfac..6f3d86e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2069,21 +2069,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.0" @@ -3040,7 +3025,7 @@ dependencies = [ "tokio-rustls 0.24.1", "tokio-util", "tracing", - "webpki-roots", + "webpki-roots 0.25.2", ] [[package]] @@ -3485,24 +3470,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -3681,50 +3648,12 @@ dependencies = [ "pathdiff", ] -[[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" -dependencies = [ - "bitflags 2.4.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "os_info" version = "3.7.0" @@ -4552,7 +4481,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -6028,6 +5957,8 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "rust_decimal", + "rustls 0.20.9", + "rustls-pemfile", "serde", "serde_json", "sha1", @@ -6041,6 +5972,7 @@ dependencies = [ "tokio-stream", "url", "uuid", + "webpki-roots 0.22.6", "whoami", ] @@ -6069,10 +6001,9 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" dependencies = [ - "native-tls", "once_cell", "tokio", - "tokio-native-tls", + "tokio-rustls 0.23.4", ] [[package]] @@ -6400,16 +6331,6 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.23.4" @@ -7326,6 +7247,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "webpki-roots" version = "0.25.2" diff --git a/crates/db/Cargo.toml b/crates/db/Cargo.toml index cc3d762..ee5de98 100644 --- a/crates/db/Cargo.toml +++ b/crates/db/Cargo.toml @@ -20,7 +20,7 @@ default-features = false features = [ "macros", "sqlx-postgres", - "runtime-tokio-native-tls", + "runtime-tokio-rustls", "with-time" ] diff --git a/crates/migration/Cargo.toml b/crates/migration/Cargo.toml index 16979a2..bc6311a 100644 --- a/crates/migration/Cargo.toml +++ b/crates/migration/Cargo.toml @@ -12,7 +12,7 @@ path = "src/lib.rs" anyhow = "1.0.71" clap = { version = "3.2", default-features = false } sea-orm-cli = { version = "0.11.3", default-features = false } -sea-orm-migration = { version = "0.11.3", features = ["runtime-tokio-native-tls", "sqlx-postgres"] } +sea-orm-migration = { version = "0.11.3", features = ["runtime-tokio-rustls", "sqlx-postgres"] } tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread"] } tracing = "0.1.37"