Skip to content

Commit

Permalink
Replace openssl with rustls + ring + webpki_roots (kaspanet#547)
Browse files Browse the repository at this point in the history
* Remove openssl and replace with rustls + ring + webpki_roots

* - init calls, - unused imports

- Removed init calls
- Removed unused imports

* Add rustls to network stack

---------

Co-authored-by: starkbamse <139136798+starkbamse@users.noreply.github.com>
  • Loading branch information
elichai and saefstroem authored Sep 9, 2024
1 parent 27cef9e commit 7271509
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 227 deletions.
333 changes: 135 additions & 198 deletions Cargo.lock

Large diffs are not rendered by default.

37 changes: 20 additions & 17 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,46 +274,49 @@ 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.18.0" }
workflow-d3 = { version = "0.18.0" }
workflow-dom = { version = "0.18.0" }
workflow-http = { version = "0.18.0", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
workflow-log = { version = "0.18.0" }
workflow-node = { version = "0.18.0" }
workflow-nw = { version = "0.18.0" }
workflow-rpc = { version = "0.18.0", default-features = false, features = ["rustls-tls-webpki-roots"] }
workflow-serializer = { version = "0.18.0" }
workflow-store = { version = "0.18.0" }
workflow-terminal = { version = "0.18.0" }
workflow-wasm = { version = "0.18.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-http = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master", default-features = false, features = ["rustls-tls-webpki-roots", "http2", "charset", "macos-system-configuration"] }
# 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-rpc = { git = "https://github.com/workflow-rs/workflow-rs.git", branch = "master", default-features = false, features = ["rustls-tls-webpki-roots"] }
# 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" }
Expand Down
1 change: 1 addition & 0 deletions rpc/grpc/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tokio-stream.workspace = true
tonic = { workspace = true, features = ["gzip"] }
triggered.workspace = true
futures-util.workspace = true
rustls.workspace = true

[features]
heap = []
1 change: 1 addition & 0 deletions rpc/grpc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ tokio-stream.workspace = true
tonic = { workspace = true, features = ["gzip"] }
triggered.workspace = true
uuid.workspace = true
rustls.workspace = true

[dev-dependencies]
kaspa-grpc-client.workspace = true
1 change: 1 addition & 0 deletions rpc/wrpc/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ workflow-log.workspace = true
workflow-rpc.workspace = true
workflow-serializer.workspace = true
workflow-wasm.workspace = true
rustls.workspace = true
11 changes: 1 addition & 10 deletions rpc/wrpc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,4 @@ 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"] }
rustls.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
2 changes: 1 addition & 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 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 7271509

Please sign in to comment.