tokio-postgres-native-tls 0.1.0-rc.1

TLS support for tokio-postgres via native-tls

TLS support for tokio-postgres via `native-tls.

Example

use native_tls::{Certificate, TlsConnector};
use tokio_postgres_native_tls::MakeTlsConnector;
use std::fs;

let cert = fs::read("database_cert.pem").unwrap();
let cert = Certificate::from_pem(&cert).unwrap();
let connector = TlsConnector::builder()
.add_root_certificate(cert)
.build()
.unwrap();
let connector = MakeTlsConnector::new(connector);

let connect_future = tokio_postgres::connect(
"host=localhost user=postgres sslmode=require",
connector,
);

// ...