Skip to content

Commit 1f51d31

Browse files
committed
Update rustls to work as expected
1 parent 144b488 commit 1f51d31

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

examples/postgres/pooled-with-rustls/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
diesel = { version = "2.1.0", default-features = false, features = ["postgres"] }
9+
diesel = { version = "2.2.0", default-features = false, features = ["postgres"] }
1010
diesel-async = { version = "0.4.0", path = "../../../", features = ["bb8", "postgres"] }
1111
futures-util = "0.3.21"
12-
rustls = "0.20.8"
13-
rustls-native-certs = "0.6.2"
12+
rustls = "0.23.8"
13+
rustls-native-certs = "0.7.1"
1414
tokio = { version = "1.2.0", default-features = false, features = ["macros", "rt-multi-thread"] }
1515
tokio-postgres = "0.7.7"
16-
tokio-postgres-rustls = "0.9.0"
16+
tokio-postgres-rustls = "0.12.0"

examples/postgres/pooled-with-rustls/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ fn establish_connection(config: &str) -> BoxFuture<ConnectionResult<AsyncPgConne
4343
let fut = async {
4444
// We first set up the way we want rustls to work.
4545
let rustls_config = rustls::ClientConfig::builder()
46-
.with_safe_defaults()
4746
.with_root_certificates(root_certs())
4847
.with_no_client_auth();
4948
let tls = tokio_postgres_rustls::MakeRustlsConnect::new(rustls_config);

examples/postgres/run-pending-migrations-with-rustls/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
diesel = { version = "2.1.0", default-features = false, features = ["postgres"] }
9+
diesel = { version = "2.2.0", default-features = false, features = ["postgres"] }
1010
diesel-async = { version = "0.4.0", path = "../../../", features = ["bb8", "postgres", "async-connection-wrapper"] }
11-
diesel_migrations = "2.1.0"
11+
diesel_migrations = "2.2.0"
1212
futures-util = "0.3.21"
13-
rustls = "0.20.8"
14-
rustls-native-certs = "0.6.2"
13+
rustls = "0.23.10"
14+
rustls-native-certs = "0.7.1"
1515
tokio = { version = "1.2.0", default-features = false, features = ["macros", "rt-multi-thread"] }
1616
tokio-postgres = "0.7.7"
17-
tokio-postgres-rustls = "0.9.0"
17+
tokio-postgres-rustls = "0.12.0"

examples/postgres/run-pending-migrations-with-rustls/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ fn establish_connection(config: &str) -> BoxFuture<ConnectionResult<AsyncPgConne
2929
let fut = async {
3030
// We first set up the way we want rustls to work.
3131
let rustls_config = rustls::ClientConfig::builder()
32-
.with_safe_defaults()
3332
.with_root_certificates(root_certs())
3433
.with_no_client_auth();
3534
let tls = tokio_postgres_rustls::MakeRustlsConnect::new(rustls_config);
@@ -49,7 +48,6 @@ fn establish_connection(config: &str) -> BoxFuture<ConnectionResult<AsyncPgConne
4948
fn root_certs() -> rustls::RootCertStore {
5049
let mut roots = rustls::RootCertStore::empty();
5150
let certs = rustls_native_certs::load_native_certs().expect("Certs not loadable!");
52-
let certs: Vec<_> = certs.into_iter().map(|cert| cert.0).collect();
53-
roots.add_parsable_certificates(&certs);
51+
roots.add_parsable_certificates(certs);
5452
roots
5553
}

0 commit comments

Comments
 (0)