Crate opengauss_openssl
source ·Expand description
TLS support for tokio-postgres
and postgres
via openssl
.
Examples
use openssl::ssl::{SslConnector, SslMethod};
use opengauss_openssl::MakeTlsConnector;
let mut builder = SslConnector::builder(SslMethod::tls())?;
builder.set_ca_file("database_cert.pem")?;
let connector = MakeTlsConnector::new(builder.build());
let connect_future = tokio_opengauss::connect(
"host=localhost user=postgres password=openGauss#2023 sslmode=require",
connector,
);
// ...
use openssl::ssl::{SslConnector, SslMethod};
use opengauss_openssl::MakeTlsConnector;
let mut builder = SslConnector::builder(SslMethod::tls())?;
builder.set_ca_file("database_cert.pem")?;
let connector = MakeTlsConnector::new(builder.build());
let client = opengauss::Client::connect(
"host=localhost user=postgres sslmode=require",
connector,
)?;
// ...
Structs
- A
MakeTlsConnect
implementation using theopenssl
crate. - A
TlsConnect
implementation using theopenssl
crate. - The stream returned by
TlsConnector
.