Upgrade native-tls
This commit is contained in:
parent
7b5fa05a30
commit
5c89b35785
@ -4,6 +4,6 @@ version = "0.1.0"
|
|||||||
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
native-tls = "0.1"
|
native-tls = "0.2"
|
||||||
|
|
||||||
postgres = { version = "0.15", path = "../postgres" }
|
postgres = { version = "0.15", path = "../postgres" }
|
||||||
|
@ -22,7 +22,7 @@ impl Debug for NativeTls {
|
|||||||
|
|
||||||
impl NativeTls {
|
impl NativeTls {
|
||||||
pub fn new() -> Result<NativeTls, native_tls::Error> {
|
pub fn new() -> Result<NativeTls, native_tls::Error> {
|
||||||
let connector = TlsConnector::builder()?.build()?;
|
let connector = TlsConnector::builder().build()?;
|
||||||
Ok(NativeTls::with_connector(connector))
|
Ok(NativeTls::with_connector(connector))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ fn connect() {
|
|||||||
let cert = include_bytes!("../../test/server.crt");
|
let cert = include_bytes!("../../test/server.crt");
|
||||||
let cert = Certificate::from_pem(cert).unwrap();
|
let cert = Certificate::from_pem(cert).unwrap();
|
||||||
|
|
||||||
let mut builder = TlsConnector::builder().unwrap();
|
let mut builder = TlsConnector::builder();
|
||||||
builder.add_root_certificate(cert).unwrap();
|
builder.add_root_certificate(cert);
|
||||||
let connector = builder.build().unwrap();
|
let connector = builder.build().unwrap();
|
||||||
|
|
||||||
let handshake = NativeTls::with_connector(connector);
|
let handshake = NativeTls::with_connector(connector);
|
||||||
|
Loading…
Reference in New Issue
Block a user