Skip to content

Commit

Permalink
Fix cloud-relay build.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Dec 11, 2021
1 parent 454a046 commit f00399b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
11 changes: 10 additions & 1 deletion Cargo.lock

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

5 changes: 2 additions & 3 deletions cloud-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
acme-lib = "0.8.2"
anyhow = "1.0.44"
clap = "3.0.0-beta.5"
clap = { version = "3.0.0-rc.4", features = ["derive"] }
hex = "0.4.3"
libp2p = { version = "0.41.0", features = [
"noise",
Expand All @@ -21,9 +21,8 @@ libp2p = { version = "0.41.0", features = [
"yamux",
"relay"
], default_features = false }
rustls = "0.20.2"
rustls-pemfile = "0.2.1"
tokio = { version = "1.12.0", features = ["full"] }
tracing = "0.1.28"
tracing-subscriber = "0.3.3"
warp = "0.3.1"

8 changes: 4 additions & 4 deletions cloud-relay/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ async fn main() -> anyhow::Result<()> {
acme::get_cert(domain, email, &opts.tls_cert, &opts.tls_private_key).await?;
}

let der = rustls::internal::pemfile::pkcs8_private_keys(&mut BufReader::new(
let der = rustls_pemfile::pkcs8_private_keys(&mut BufReader::new(
fs::File::open(&opts.tls_private_key)?,
))
.map_err(|_| anyhow::anyhow!("Reading TLS private key"))?
.into_iter()
.next()
.context("Extracting private key")?;
let private_key = websocket::tls::PrivateKey::new(der.0);
let private_key = websocket::tls::PrivateKey::new(der);

let certs = rustls::internal::pemfile::certs(&mut BufReader::new(fs::File::open(
let certs = rustls_pemfile::certs(&mut BufReader::new(fs::File::open(
&opts.tls_cert,
)?))
.map_err(|_| anyhow::anyhow!("Reading TLS cert chain"))?
.into_iter()
.map(|x| websocket::tls::Certificate::new(x.0))
.map(|x| websocket::tls::Certificate::new(x))
.collect();
Some((private_key, certs))
} else {
Expand Down

0 comments on commit f00399b

Please sign in to comment.