Skip to content

Commit

Permalink
agent: setup rustls CryptoProvider
Browse files Browse the repository at this point in the history
Fixes a crash in `agent` due to missing a `CryptoProvider` for `rustls`
TLS connections.
  • Loading branch information
psFried committed Oct 8, 2024
1 parent 4670440 commit ddde1b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ lazy_static = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
rustls = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions crates/agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ struct Args {
}

fn main() -> Result<(), anyhow::Error> {
// Required in order for libraries to use `rustls` for TLS.
// See: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html
rustls::crypto::aws_lc_rs::default_provider()
.install_default()
.expect("failed to install default crypto provider");

// Use reasonable defaults for printing structured logs to stderr.
let subscriber = tracing_subscriber::FmtSubscriber::builder()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
Expand Down

0 comments on commit ddde1b2

Please sign in to comment.