Skip to content

Commit

Permalink
Remove openssl and replace with rustls + ring + webpki_roots
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai committed Sep 7, 2024
1 parent afbcf9e commit 12f3028
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 238 deletions.
313 changes: 115 additions & 198 deletions Cargo.lock

Large diffs are not rendered by default.

57 changes: 30 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ thiserror = "1.0.50"
tokio = { version = "1.33.0", features = ["sync", "rt-multi-thread"] }
tokio-stream = "0.1.14"
toml = "0.8.8"
tonic = { version = "0.10.2", features = ["tls", "gzip", "transport"] }
tonic = { version = "0.10.2", features = ["tls-webpki-roots", "gzip", "transport"] }
tonic-build = { version = "0.10.2", features = ["prost"] }
triggered = "0.1.2"
uuid = { version = "1.5.0", features = ["v4", "fast-rng", "serde"] }
Expand All @@ -274,50 +274,53 @@ indexed_db_futures = "0.5.0"
# workflow-perf-monitor = { path = "../../../workflow-perf-monitor-rs" }
workflow-perf-monitor = "0.0.2"
nw-sys = "0.1.6"
rustls = { version = "0.23", default-features = false, features = ["ring"] }

# workflow dependencies
workflow-core = { version = "0.17.0" }
workflow-d3 = { version = "0.17.0" }
workflow-dom = { version = "0.17.0" }
workflow-http = { version = "0.17.0" }
workflow-log = { version = "0.17.0" }
workflow-node = { version = "0.17.0" }
workflow-nw = { version = "0.17.0" }
workflow-rpc = { version = "0.17.0" }
workflow-serializer = { version = "0.17.0" }
workflow-store = { version = "0.17.0" }
workflow-terminal = { version = "0.17.0" }
workflow-wasm = { version = "0.17.0" }
# workflow-core = { version = "0.17.0" }
# workflow-d3 = { version = "0.17.0" }
# workflow-dom = { version = "0.17.0" }
# workflow-http = { version = "0.17.0" }
# workflow-log = { version = "0.17.0" }
# workflow-node = { version = "0.17.0" }
# workflow-nw = { version = "0.17.0" }
# workflow-rpc = { version = "0.17.0" }
# workflow-serializer = { version = "0.17.0" }
# workflow-store = { version = "0.17.0" }
# workflow-terminal = { version = "0.17.0" }
# workflow-wasm = { version = "0.17.0" }

# if below is enabled, this means that there is an ongoing work
# on the workflow-rs crate. This requires that you clone workflow-rs
# into a sibling folder from https://github.com/workflow-rs/workflow-rs
# workflow-core = { path = "../workflow-rs/core" }
# workflow-d3 = { path = "../workflow-rs/d3" }
# workflow-dom = { path = "../workflow-rs/dom" }
# workflow-http = { path = "../workflow-rs/http" }
# # Same features as default but with rustls-tls-webpki-roots instead of native-tls
# workflow-http = { path = "../workflow-rs/http", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
# workflow-log = { path = "../workflow-rs/log" }
# workflow-node = { path = "../workflow-rs/node" }
# workflow-nw = { path = "../workflow-rs/nw" }
# workflow-rpc = { path = "../workflow-rs/rpc" }
# workflow-rpc = { path = "../workflow-rs/rpc", default-features = false, features = ["rustls-tls-webpki-roots"] }
# workflow-serializer = { path = "../workflow-rs/serializer" }
# workflow-store = { path = "../workflow-rs/store" }
# workflow-terminal = { path = "../workflow-rs/terminal" }
# workflow-wasm = { path = "../workflow-rs/wasm" }


# ---
# workflow-core = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-d3 = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-dom = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-http = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-log = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-node = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-nw = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-rpc = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-serializer = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-store = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-terminal = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
# workflow-wasm = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master" }
workflow-core = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-d3 = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-dom = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-http = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
workflow-log = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-node = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-nw = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-rpc = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head", default-features = false, features = ["rustls-tls-webpki-roots"] }
workflow-serializer = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-store = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-terminal = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
workflow-wasm = { git = "https://github.com/workflow-rs/workflow-rs.git", rev = "refs/pull/13/head" }
# https://github.com/aspectron/nw-sys
# nw-sys = { path = "../nw-sys" }

Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ workflow-nw.workspace = true
workflow-store.workspace = true
workflow-terminal.workspace = true
workflow-wasm.workspace = true
rustls.workspace = true

[dependencies.web-sys]
workspace = true
Expand Down
2 changes: 2 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl KaspaCli {
}
}

rustls::crypto::ring::default_provider().install_default().unwrap();

workflow_log::set_colors_enabled(true);
}

Expand Down
1 change: 1 addition & 0 deletions kaspad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ tempfile.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["rt", "macros", "rt-multi-thread"] }
workflow-log.workspace = true
rustls.workspace = true

toml = "0.8.10"
serde_with = "3.7.0"
Expand Down
2 changes: 2 additions & 0 deletions kaspad/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub fn main() {

init_allocator_with_default_settings();

rustls::crypto::ring::default_provider().install_default().unwrap();

let args = parse_args();

match fd_budget::try_set_fd_limit(DESIRED_DAEMON_SOFT_FD_LIMIT) {
Expand Down
1 change: 1 addition & 0 deletions rpc/wrpc/examples/subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tokio.workspace = true
workflow-core.workspace = true
workflow-log.workspace = true
ctrlc.workspace = true
rustls.workspace = true
1 change: 1 addition & 0 deletions rpc/wrpc/examples/subscriber/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ impl Listener {

#[tokio::main]
async fn main() -> Result<()> {
rustls::crypto::ring::default_provider().install_default().unwrap();
let listener = Listener::try_new(NetworkId::new(NetworkType::Mainnet), None)?;

let (shutdown_sender, shutdown_receiver) = oneshot::<()>();
Expand Down
1 change: 1 addition & 0 deletions rpc/wrpc/proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tokio.workspace = true
workflow-core.workspace = true
workflow-log.workspace = true
workflow-rpc.workspace = true
rustls.workspace = true

[package.metadata.emanate.build]
folder = "setup"
2 changes: 2 additions & 0 deletions rpc/wrpc/proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ struct Args {

#[tokio::main]
async fn main() -> Result<()> {
rustls::crypto::ring::default_provider().install_default().unwrap();

let Args { testnet, simnet, devnet, grpc_proxy_address, interface, verbose, threads, encoding } = Args::parse();

let network_type = if testnet {
Expand Down
12 changes: 1 addition & 11 deletions rpc/wrpc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,4 @@ tokio.workspace = true
workflow-core.workspace = true
workflow-log.workspace = true
workflow-rpc.workspace = true
workflow-serializer.workspace = true

# Adding explicitely the openssl dependency here is needed for a successful build with zigbuild and musl
# as used in the release deployment in GitHub CI
# see: https://github.com/rust-cross/cargo-zigbuild/issues/127

[target.x86_64-unknown-linux-gnu.dependencies]
openssl = { version = "0.10", features = ["vendored"] }

[target.x86_64-unknown-linux-musl.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
workflow-serializer.workspace = true
1 change: 1 addition & 0 deletions rpc/wrpc/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ js-sys.workspace = true
wasm-bindgen-futures.workspace = true
workflow-core.workspace = true
futures.workspace = true
ring = { version = "0.17", features = ["wasm32_unknown_unknown_js"] }

[lints]
workspace = true
3 changes: 2 additions & 1 deletion simpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license.workspace = true
repository.workspace = true

[dependencies]
kaspa-alloc.workspace = true # This changes the global allocator for all of the next dependencies so should be kept first
kaspa-alloc.workspace = true # This changes the global allocator for all of the next dependencies so should be kept first
kaspa-consensus-core.workspace = true
kaspa-consensus-notify.workspace = true
kaspa-consensus.workspace = true
Expand All @@ -36,6 +36,7 @@ rand.workspace = true
rayon.workspace = true
secp256k1.workspace = true
tokio = { workspace = true, features = ["rt", "macros", "rt-multi-thread"] }
rustls.workspace = true

[features]
heap = ["dhat", "kaspa-alloc/heap"]
Expand Down
2 changes: 2 additions & 0 deletions simpa/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ fn main() {

init_allocator_with_default_settings();

rustls::crypto::ring::default_provider().install_default().unwrap();

// Get CLI arguments
let args = Args::parse();

Expand Down
2 changes: 1 addition & 1 deletion wallet/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ wasm-bindgen-futures.workspace = true
wasm-bindgen.workspace = true
workflow-log.workspace = true
workflow-terminal.workspace = true
workflow-wasm.workspace = true
workflow-wasm.workspace = true

0 comments on commit 12f3028

Please sign in to comment.