feat: allow using native-tls or rustls (#330)

This commit is contained in:
Georgios Konstantopoulos 2021-07-05 14:32:17 +03:00 committed by GitHub
parent 3234942d87
commit dd98a593e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

18
Cargo.lock generated
View File

@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3
[[package]] [[package]]
name = "Inflector" name = "Inflector"
version = "0.11.4" version = "0.11.4"
@ -2446,17 +2448,21 @@ dependencies = [
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.13.0" version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" checksum = "1e96bb520beab540ab664bd5a9cfeaa1fcd846fa68c830b42e2c8963071251d2"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
"native-tls", "native-tls",
"pin-project", "pin-project",
"rustls",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tokio-rustls",
"tungstenite", "tungstenite",
"webpki",
"webpki-roots",
] ]
[[package]] [[package]]
@ -2517,9 +2523,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.12.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093"
dependencies = [ dependencies = [
"base64 0.13.0", "base64 0.13.0",
"byteorder", "byteorder",
@ -2530,9 +2536,13 @@ dependencies = [
"log", "log",
"native-tls", "native-tls",
"rand 0.8.3", "rand 0.8.3",
"rustls",
"sha-1", "sha-1",
"thiserror",
"url", "url",
"utf-8", "utf-8",
"webpki",
"webpki-roots",
] ]
[[package]] [[package]]

View File

@ -18,7 +18,7 @@ ethers-core = { version = "0.2.2", path = "../ethers-core", default-features = f
async-trait = { version = "0.1.50", default-features = false } async-trait = { version = "0.1.50", default-features = false }
hex = { version = "0.4.3", default-features = false, features = ["std"] } hex = { version = "0.4.3", default-features = false, features = ["std"] }
reqwest = { version = "0.11.4", default-features = false, features = ["json", "rustls-tls"] } reqwest = { version = "0.11.4", default-features = false, features = ["json"] }
serde = { version = "1.0.124", default-features = false, features = ["derive"] } serde = { version = "1.0.124", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.64", default-features = false } serde_json = { version = "1.0.64", default-features = false }
thiserror = { version = "1.0.26", default-features = false } thiserror = { version = "1.0.26", default-features = false }
@ -38,7 +38,7 @@ tracing-futures = { version = "0.2.5", default-features = false, features = ["st
# tokio # tokio
tokio = { version = "1.5", default-features = false, optional = true } tokio = { version = "1.5", default-features = false, optional = true }
tokio-tungstenite = { version = "0.13.0", default-features = false, features = ["connect", "tls"], optional = true } tokio-tungstenite = { version = "0.14.0", default-features = false, features = ["connect"], optional = true }
tokio-util = { version = "0.6.7", default-features = false, features = ["io"], optional = true } tokio-util = { version = "0.6.7", default-features = false, features = ["io"], optional = true }
bytes = { version = "1.0.1", default-features = false, optional = true } bytes = { version = "1.0.1", default-features = false, optional = true }
@ -48,7 +48,10 @@ tokio = { version = "1.5", default-features = false, features = ["rt", "macros"]
tempfile = "3.2.0" tempfile = "3.2.0"
[features] [features]
default = ["ws", "ipc"] default = ["ws", "ipc", "rustls"]
celo = ["ethers-core/celo"] celo = ["ethers-core/celo"]
ws = ["tokio", "tokio-tungstenite"] ws = ["tokio", "tokio-tungstenite"]
ipc = ["tokio", "tokio/io-util", "tokio-util", "bytes"] ipc = ["tokio", "tokio/io-util", "tokio-util", "bytes"]
openssl = ["tokio-tungstenite/native-tls", "reqwest/native-tls"]
rustls = ["tokio-tungstenite/rustls-tls", "reqwest/rustls-tls"]