I’m trying to make a connection to an secure cocroach cluster using Rust. So I try to follow the example in the article here: https://www.bookstack.cn/read/CockroachDB/d34f4af2f9885ead.md?wd=Rust
Which starts off:
use postgres::{Connection, TlsMode};`
use postgres::tls::openssl::OpenSsl;`
use postgres::tls::openssl::openssl::ssl::{SslConnectorBuilder, SslMethod};`
use postgres::tls::openssl::openssl::x509::X509_FILETYPE_PEM;`
Sadly that fails to even start to build with " "failed to resolve: could not find openssl
in tls
Then I tried the examples here: https://docs.rs/postgres-openssl/0.2.0-rc.1/postgres_openssl/ and here: https://docs.rs/postgres-native-tls/0.2.0-rc.1/postgres_native_tls/ Each of which ends up with similar unresolved messages.
My Cargo.toml file currently contains this:
[dependencies]
openssl = "*"
postgres = "0.15.2"
postgres-openssl = "*"
postgres-native-tls = "*"
native-tls = "*"
After chasing documentation and examples around for hours and trying this and that I have totally failed to even get off the ground with this.
Does anyone have an example of working Cargo.toml and use clauses to get me started?