tokio-postgres-generic-rustls
An impelementation of TLS based on rustls for tokio-postgres
This crate allows users to select a crypto backend, or bring their own, rather than relying on
primitives provided by ring
directly. This is done through the use of x509-cert for
certificate parsing rather than X509-certificate, while also adding an abstraction for
computing digests.
By default, tokio-postgres-generic-rustls does not provide a digest implementation, but one or more are provided behind crate features.
Feature | Impelementation |
---|---|
aws-lc-rs |
AwsLcRsDigest |
ring |
RingDigest |
rustcrypto |
RustcryptoDigest |
Usage
Using this crate is fairly straightforward. First, select your digest impelementation via crate features (or provide your own), then construct rustls connector for tokio-postgres with your rustls client configuration.
The following example demonstrates providing a custom digest backend.
use ;
;
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.