Skip to content

Commit

Permalink
Revert "Use rustls"
Browse files Browse the repository at this point in the history
This reverts commit e9e6f1a.
  • Loading branch information
Theodus committed Feb 15, 2022
1 parent 55cb88f commit 74c947a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ hex = "0.4"
im = "15.0" # Good vector implementation, CHAMP encoding should be added if we use a hash map/set
lazy_static = "1.4"
num-traits = "0.2"
openssl = "0.10"
ordered-float = "2.5"
postgres-openssl = "0.5"
primitive-types = "0.8"
prometheus = "0.13"
rand = { version = "0.8", features = ["small_rng"] }
receipts = { git = "ssh://[email protected]/edgeandnode/receipts.git", rev = "02d09da" }
reqwest = { version = "0.11", default-features = false, features = [
"json",
"rustls-tls",
] }
rustls = "0.20"
reqwest = { version = "0.11", features = ["json"] }
secp256k1 = "0.20"
serde = "1.0"
serde_json = { version = "1.0", features = ["raw_value"] }
Expand All @@ -51,8 +49,7 @@ tokio = { version = "1.14", features = [
"parking_lot",
] }
tokio-postgres = { version = "0.7", features = ["runtime"] }
tokio-postgres-rustls = "0.9"
tokio-tungstenite = { version = "0.16", features = ["rustls-tls-webpki-roots"] }
tokio-tungstenite = { version = "0.16", features = ["native-tls"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = [
"env-filter",
Expand Down
16 changes: 7 additions & 9 deletions src/stats_db.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{prelude::*, query_engine::APIKey};
use rustls;
use openssl::ssl::{SslConnector, SslMethod, SslVerifyMode};
use postgres_openssl::MakeTlsConnector;
use std::{
collections::{hash_map::Entry, HashMap},
error::Error,
Expand All @@ -11,7 +12,6 @@ use tokio::{
time::{interval, Interval},
};
use tokio_postgres::{self, types::Type};
use tokio_postgres_rustls;

pub enum Msg {
AddQuery {
Expand Down Expand Up @@ -83,13 +83,11 @@ pub async fn create(
"postgres://{}:{}@{}:{}/{}?sslmode=prefer",
user, password, host, port, dbname,
);
let tls = tokio_postgres_rustls::MakeRustlsConnect::new(
rustls::ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(rustls::RootCertStore::empty())
.with_no_client_auth(),
);
let (client, connection) = tokio_postgres::connect(&config, tls).await?;
let mut ssl_builder = SslConnector::builder(SslMethod::tls()).unwrap();
ssl_builder.set_verify(SslVerifyMode::NONE);
let ssl_connector = ssl_builder.build();
let (client, connection) =
tokio_postgres::connect(&config, MakeTlsConnector::new(ssl_connector)).await?;
// The connection object performs the actual communication with the database and is intended to
// be executed on its own spawned task.
tokio::spawn(async move {
Expand Down

0 comments on commit 74c947a

Please sign in to comment.