Skip to content

Commit c3c9b5d

Browse files
committed
improvement: remove openssl dependency
1 parent da29bdd commit c3c9b5d

File tree

4 files changed

+73
-98
lines changed

4 files changed

+73
-98
lines changed

Cargo.lock

Lines changed: 59 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lazy_static = "1.4"
3939
governor = "0.4"
4040
nonzero_ext = "0.3"
4141
hyper = { version="0.14", features=["client", "server","http1","http2","tcp"] }
42-
hyper-tls = "0.5"
42+
hyper-rustls = { version = "0.24" }
4343
http = { version = "0.2" }
4444
parse_duration = "2"
4545
rand = "0.8"

src/nip05.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::repo::NostrRepo;
1111
use hyper::body::HttpBody;
1212
use hyper::client::connect::HttpConnector;
1313
use hyper::Client;
14-
use hyper_tls::HttpsConnector;
14+
use hyper_rustls::HttpsConnector;
1515
use std::sync::Arc;
1616
use std::time::Duration;
1717
use std::time::Instant;
@@ -133,7 +133,12 @@ impl Verifier {
133133
) -> Result<Self> {
134134
info!("creating NIP-05 verifier");
135135
// setup hyper client
136-
let https = HttpsConnector::new();
136+
let https = hyper_rustls::HttpsConnectorBuilder::new()
137+
.with_native_roots()
138+
.https_or_http()
139+
.enable_http1()
140+
.build();
141+
137142
let client = Client::builder().build::<_, hyper::Body>(https);
138143

139144
// After all accounts have been re-verified, don't check again

src/payment/lnbits.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use http::Uri;
33
use hyper::client::connect::HttpConnector;
44
use hyper::Client;
5-
use hyper_tls::HttpsConnector;
5+
use hyper_rustls::HttpsConnector;
66
use nostr::Keys;
77
use serde::{Deserialize, Serialize};
88
use serde_json::Value;
@@ -72,7 +72,11 @@ pub struct LNBitsPaymentProcessor {
7272
impl LNBitsPaymentProcessor {
7373
pub fn new(settings: &Settings) -> Self {
7474
// setup hyper client
75-
let https = HttpsConnector::new();
75+
let https = hyper_rustls::HttpsConnectorBuilder::new()
76+
.with_native_roots()
77+
.https_only()
78+
.enable_http1()
79+
.build();
7680
let client = Client::builder().build::<_, hyper::Body>(https);
7781

7882
Self {

0 commit comments

Comments
 (0)