Skip to content

Commit cf2cfa4

Browse files
authored
make the subdependency on on aws-lc-rs optional (#25)
* remove default features from rustls dependency * remove default features from tokio-rustls dependency * The subdependency on aws-lc-rs (dependency of rustls) is no optional * activate tls1.2 in sqlx macros
1 parent b4b034a commit cf2cfa4

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## 0.6.43
99
- Fix decoding of small negative unsigned integer in Mssql.
10+
- The subdependency on aws-lc-rs (dependency of rustls) is no optional. You can use your own crypto provider (such as ring or openssl) by using the new crate feature `runtime-tokio-rustls-nocrypto` instead of `runtime-tokio-rustls`.
1011

1112
## 0.6.42
1213
- Fix `QueryBuilder` for Microsoft SQL Server: https://github.com/sqlpage/sqlx-oldapi/issues/11

Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,32 @@ runtime-tokio-native-tls = [
9090

9191
runtime-actix-rustls = ["runtime-tokio-rustls"]
9292
runtime-async-std-rustls = [
93+
"sqlx-core/runtime-async-std-rustls",
94+
"sqlx-macros/runtime-async-std-rustls",
95+
"aws_lc_rs",
96+
"tls12",
97+
"_rt-async-std",
98+
]
99+
runtime-async-std-rustls-nocrypto = [
93100
"sqlx-core/runtime-async-std-rustls",
94101
"sqlx-macros/runtime-async-std-rustls",
95102
"_rt-async-std",
96103
]
97104
runtime-tokio-rustls = [
98105
"sqlx-core/runtime-tokio-rustls",
99106
"sqlx-macros/runtime-tokio-rustls",
107+
"aws_lc_rs",
108+
"tls12",
100109
"_rt-tokio",
101110
]
111+
runtime-tokio-rustls-nocrypto = [
112+
"sqlx-core/runtime-tokio-rustls",
113+
"sqlx-macros/runtime-tokio-rustls",
114+
"_rt-tokio",
115+
]
116+
117+
aws_lc_rs = ["sqlx-core/aws_lc_rs"]
118+
tls12 = ["sqlx-core/tls12"]
102119

103120
# for conditional compilation
104121
_rt-async-std = []

sqlx-core/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ _rt-async-std = []
9393
_rt-tokio = ["tokio-stream", "tokio-util"]
9494
_tls-native-tls = []
9595
_tls-rustls = ["rustls", "rustls-pemfile", "webpki-roots"]
96+
aws_lc_rs = ["rustls/aws_lc_rs", "sqlx-rt/aws_lc_rs"]
97+
tls12 = ["rustls/tls12"]
9698

9799
# support offline/decoupled building (enables serialization of `Describe`)
98100
offline = ["serde", "either/serde"]
@@ -144,7 +146,7 @@ percent-encoding = "2.1.0"
144146
rand = { version = "0.8", default-features = false, optional = true, features = ["std", "std_rng"] }
145147
regex = { version = "1.5.5", optional = true }
146148
rsa = { version = "0.9.2", optional = true }
147-
rustls = { version = "0.23", optional = true }
149+
rustls = { version = "0.23", optional = true, default-features = false }
148150
rustls-pemfile = { version = "2.1", optional = true }
149151
serde = { version = "1.0.132", features = ["derive", "rc"], optional = true }
150152
serde_json = { version = "1.0.73", features = ["raw_value"], optional = true }

sqlx-macros/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ heck = { version = "0.5" }
7575
either = "1.6.1"
7676
once_cell = "1.9.0"
7777
proc-macro2 = { version = "1.0.36", default-features = false }
78-
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.43", default-features = false, features = ["any"], path = "../sqlx-core" }
79-
sqlx-rt = { version = "0.6.43", default-features = false, path = "../sqlx-rt", package = "sqlx-rt-oldapi" }
78+
sqlx-core = { package = "sqlx-core-oldapi", version = "0.6.43", default-features = false, features = ["any", "aws_lc_rs", "tls12"], path = "../sqlx-core" }
79+
sqlx-rt = { version = "0.6.43", default-features = false, path = "../sqlx-rt", package = "sqlx-rt-oldapi", features = ["aws_lc_rs"] }
8080
serde = { version = "1.0.132", features = ["derive"], optional = true }
8181
serde_json = { version = "1.0.73", optional = true }
8282
sha2 = { version = "0.10.0", optional = true }

sqlx-rt/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ runtime-tokio-native-tls = ["_rt-tokio", "_tls-native-tls", "tokio-native-tls"]
2121
runtime-actix-rustls = ["runtime-tokio-rustls"]
2222
runtime-async-std-rustls = ["_rt-async-std", "_tls-rustls", "futures-rustls"]
2323
runtime-tokio-rustls = ["_rt-tokio", "_tls-rustls", "tokio-rustls"]
24+
aws_lc_rs = ["tokio-rustls/aws_lc_rs"]
2425

2526
# Not used directly and not re-exported from sqlx
2627
_rt-async-std = ["async-std"]
@@ -34,7 +35,7 @@ async-native-tls = { version = "0.5.0", optional = true }
3435
futures-rustls = { version = "0.26", optional = true }
3536
async-std = { version = "1.7.0", features = ["unstable"], optional = true }
3637
tokio-native-tls = { version = "0.3.0", optional = true }
37-
tokio-rustls = { version = "0.26", optional = true }
38+
tokio-rustls = { version = "0.26", optional = true, default-features = false }
3839
native-tls = { version = "0.2.4", optional = true }
3940
once_cell = { version = "1.4", features = ["std"], optional = true }
4041

0 commit comments

Comments
 (0)