Skip to content

Commit

Permalink
improvement: remove openssl dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
scsibug committed Sep 4, 2023
1 parent da29bdd commit c3c9b5d
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 98 deletions.
152 changes: 59 additions & 93 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ lazy_static = "1.4"
governor = "0.4"
nonzero_ext = "0.3"
hyper = { version="0.14", features=["client", "server","http1","http2","tcp"] }
hyper-tls = "0.5"
hyper-rustls = { version = "0.24" }
http = { version = "0.2" }
parse_duration = "2"
rand = "0.8"
Expand Down
9 changes: 7 additions & 2 deletions src/nip05.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::repo::NostrRepo;
use hyper::body::HttpBody;
use hyper::client::connect::HttpConnector;
use hyper::Client;
use hyper_tls::HttpsConnector;
use hyper_rustls::HttpsConnector;
use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;
Expand Down Expand Up @@ -133,7 +133,12 @@ impl Verifier {
) -> Result<Self> {
info!("creating NIP-05 verifier");
// setup hyper client
let https = HttpsConnector::new();
let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.build();

let client = Client::builder().build::<_, hyper::Body>(https);

// After all accounts have been re-verified, don't check again
Expand Down
8 changes: 6 additions & 2 deletions src/payment/lnbits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use http::Uri;
use hyper::client::connect::HttpConnector;
use hyper::Client;
use hyper_tls::HttpsConnector;
use hyper_rustls::HttpsConnector;
use nostr::Keys;
use serde::{Deserialize, Serialize};
use serde_json::Value;
Expand Down Expand Up @@ -72,7 +72,11 @@ pub struct LNBitsPaymentProcessor {
impl LNBitsPaymentProcessor {
pub fn new(settings: &Settings) -> Self {
// setup hyper client
let https = HttpsConnector::new();
let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_only()
.enable_http1()
.build();
let client = Client::builder().build::<_, hyper::Body>(https);

Self {
Expand Down

0 comments on commit c3c9b5d

Please sign in to comment.