Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbg/tokio-postgres-rustls
Integration between rustls and tokio-postgres
https://github.com/jbg/tokio-postgres-rustls
postgres postgresql rust
Last synced: 6 days ago
JSON representation
Integration between rustls and tokio-postgres
- Host: GitHub
- URL: https://github.com/jbg/tokio-postgres-rustls
- Owner: jbg
- License: mit
- Created: 2019-07-12T22:17:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T22:23:16.000Z (4 months ago)
- Last Synced: 2025-01-29T02:41:07.142Z (13 days ago)
- Topics: postgres, postgresql, rust
- Language: Rust
- Homepage:
- Size: 37.1 KB
- Stars: 31
- Watchers: 4
- Forks: 31
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tokio-postgres-rustls
This is an integration between the [rustls TLS stack](https://github.com/ctz/rustls)
and the [tokio-postgres asynchronous PostgreSQL client library](https://github.com/sfackler/rust-postgres).[![Crate](https://img.shields.io/crates/v/tokio-postgres-rustls.svg)](https://crates.io/crates/tokio-postgres-rustls)
[API Documentation](https://docs.rs/tokio-postgres-rustls/)
# Example
```
let config = rustls::ClientConfig::builder()
.with_root_certificates(rustls::RootCertStore::empty())
.with_no_client_auth();
let tls = tokio_postgres_rustls::MakeRustlsConnect::new(config);
let connect_fut = tokio_postgres::connect("sslmode=require host=localhost user=postgres", tls);
// ...
```# License
tokio-postgres-rustls is distributed under the MIT license.