Skip to content

Commit

Permalink
Load "legacy" openssl provider for deprecated ciphers and algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
ancwrd1 committed Jan 7, 2025
1 parent f2322e1 commit b987c12
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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 snx-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ libc = "0.2"
tracing-subscriber = "0.3"
clap = { version = "4.5.4", features = ["derive"] }
ipnet = { version = "2", features = ["serde"] }
openssl = "0.10"
13 changes: 12 additions & 1 deletion snx-rs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
use std::{collections::VecDeque, future::Future, sync::Arc};
use std::{
collections::VecDeque,
future::Future,
sync::{Arc, OnceLock},
};

use anyhow::anyhow;
use clap::Parser;
use futures::pin_mut;
use openssl::provider::Provider;
use tokio::{
signal::unix,
sync::{mpsc, oneshot},
Expand Down Expand Up @@ -64,6 +69,12 @@ async fn main() -> anyhow::Result<()> {
return Err(anyhow!("Please run me as a root user!"));
}

static LEGACY_PROVIDER: OnceLock<Provider> = OnceLock::new();

if let Ok(provider) = Provider::try_load(None, "legacy", true) {
let _ = LEGACY_PROVIDER.set(provider);
}

let mode = cmdline_params.mode;

let mut params = if let Some(ref config_file) = cmdline_params.config_file {
Expand Down

0 comments on commit b987c12

Please sign in to comment.