File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
examples/postgres/pooled-with-rustls/src Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ let mut conn = pool.get().await?;
168
168
let res = users :: table . select (User :: as_select ()). load :: (& mut conn ). await ? ;
169
169
```
170
170
171
+ ## Diesel-Async with Secure Database
172
+
173
+ In the event of using this crate with a ` sslmode=require ` flag, it will be necessary to build a TLS cert.
174
+ There is an example provided for doing this using the ` rustls ` crate in the ` postgres ` examples folder.
175
+
171
176
## Crate Feature Flags
172
177
173
178
Diesel-async offers several configurable features:
Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ fn establish_connection(config: &str) -> BoxFuture<ConnectionResult<AsyncPgConne
63
63
fn root_certs ( ) -> rustls:: RootCertStore {
64
64
let mut roots = rustls:: RootCertStore :: empty ( ) ;
65
65
let certs = rustls_native_certs:: load_native_certs ( ) . expect ( "Certs not loadable!" ) ;
66
- let certs: Vec < _ > = certs. into_iter ( ) . map ( |cert| cert. 0 ) . collect ( ) ;
67
- roots. add_parsable_certificates ( & certs) ;
66
+ roots. add_parsable_certificates ( certs) ;
68
67
roots
69
68
}
You can’t perform that action at this time.
0 commit comments