| Crates.io | rustls-tokio-postgres |
| lib.rs | rustls-tokio-postgres |
| version | 0.1.2 |
| created_at | 2025-08-24 02:43:43.735501+00 |
| updated_at | 2025-08-24 14:13:47.694789+00 |
| description | TLS implementation for tokio-postgres using rustls |
| homepage | |
| repository | https://github.com/ryanfowler/rustls-tokio-postgres |
| max_upload_size | |
| id | 1808032 |
| size | 69,859 |
A tokio_postgres TLS connector backed by rustls.
use rustls_tokio_postgres::{config_no_verify, MakeRustlsConnect};
use tokio_postgres::{connect, Config};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
static CONFIG: &str = "host=localhost user=postgres";
// This rustls config does not verify the server certificate.
// You can construct your own rustls ClientConfig, if needed.
let tls = MakeRustlsConnect::new(config_no_verify());
// Create the client with the TLS configuration.
let (_client, _conn) = connect(CONFIG, tls).await?;
Ok(())
}
rustls::ClientConfig using the rustls-native-certs crate.rustls::ClientConfig using the webpki-roots crate.