Skip to content

Instantly share code, notes, and snippets.

@mottet-dev
mottet-dev / ping-pg-tls.rs
Created March 18, 2019 21:25 — forked from choestelus/ping-pg-tls.rs
rust-postgres with TLS connection
extern crate openssl;
extern crate postgres;
use postgres::{Connection, TlsMode};
use openssl::ssl::{SslConnectorBuilder, SslMethod, SslVerifyMode};
use openssl::x509;
fn main() {
let mut connector = SslConnectorBuilder::new(SslMethod::tls()).unwrap();