-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): Bump OpenSSL base version to 3.1.* #17669
Changes from all commits
80d29ab
8090819
fa99ef1
49fd3ca
0efb5a1
8417a15
db5a763
c1460ed
fe46dcd
2c10dcd
6718861
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,7 @@ set -o errexit | |
|
||
yum install -y unzip centos-release-scl | ||
yum install -y llvm-toolset-7 | ||
|
||
# needed to compile openssl | ||
yum install -y perl-IPC-Cmd | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💭 thought: this is an odd new dependency 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed it is, it's required to compile openssl though. I can add a comment to explain. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ use futures::StreamExt; | |
#[cfg(feature = "enterprise")] | ||
use futures_util::future::BoxFuture; | ||
use once_cell::race::OnceNonZeroUsize; | ||
use openssl::provider::Provider; | ||
use tokio::{ | ||
runtime::{self, Runtime}, | ||
sync::mpsc, | ||
|
@@ -61,6 +62,7 @@ pub struct Application { | |
pub require_healthy: Option<bool>, | ||
pub config: ApplicationConfig, | ||
pub signals: SignalPair, | ||
pub openssl_legacy_provider: Option<Provider>, | ||
} | ||
|
||
impl ApplicationConfig { | ||
|
@@ -186,6 +188,12 @@ impl Application { | |
opts.root.internal_log_rate_limit, | ||
); | ||
|
||
let openssl_legacy_provider = opts | ||
.root | ||
.openssl_legacy_provider | ||
.then(load_openssl_legacy_provider) | ||
.flatten(); | ||
|
||
let runtime = build_runtime(opts.root.threads, "vector-worker")?; | ||
|
||
// Signal handler for OS and provider messages. | ||
|
@@ -206,6 +214,7 @@ impl Application { | |
require_healthy: opts.root.require_healthy, | ||
config, | ||
signals, | ||
openssl_legacy_provider, | ||
}, | ||
)) | ||
} | ||
|
@@ -222,6 +231,7 @@ impl Application { | |
require_healthy, | ||
config, | ||
signals, | ||
openssl_legacy_provider, | ||
} = self; | ||
|
||
let topology_controller = SharedTopologyController::new(TopologyController { | ||
|
@@ -239,6 +249,7 @@ impl Application { | |
graceful_crash_receiver: config.graceful_crash_receiver, | ||
signals, | ||
topology_controller, | ||
openssl_legacy_provider, | ||
}) | ||
} | ||
} | ||
|
@@ -248,6 +259,7 @@ pub struct StartedApplication { | |
pub graceful_crash_receiver: mpsc::UnboundedReceiver<()>, | ||
pub signals: SignalPair, | ||
pub topology_controller: SharedTopologyController, | ||
pub openssl_legacy_provider: Option<Provider>, | ||
} | ||
|
||
impl StartedApplication { | ||
|
@@ -261,6 +273,7 @@ impl StartedApplication { | |
graceful_crash_receiver, | ||
signals, | ||
topology_controller, | ||
openssl_legacy_provider, | ||
} = self; | ||
|
||
let mut graceful_crash = UnboundedReceiverStream::new(graceful_crash_receiver); | ||
|
@@ -315,6 +328,7 @@ impl StartedApplication { | |
signal, | ||
signal_rx, | ||
topology_controller, | ||
openssl_legacy_provider, | ||
} | ||
} | ||
} | ||
|
@@ -323,6 +337,7 @@ pub struct FinishedApplication { | |
pub signal: SignalTo, | ||
pub signal_rx: SignalRx, | ||
pub topology_controller: SharedTopologyController, | ||
pub openssl_legacy_provider: Option<Provider>, | ||
} | ||
|
||
impl FinishedApplication { | ||
|
@@ -331,6 +346,7 @@ impl FinishedApplication { | |
signal, | ||
mut signal_rx, | ||
topology_controller, | ||
openssl_legacy_provider, | ||
} = self; | ||
|
||
// At this point, we'll have the only reference to the shared topology controller and can | ||
|
@@ -340,7 +356,7 @@ impl FinishedApplication { | |
.expect("fail to unwrap topology controller") | ||
.into_inner(); | ||
|
||
match signal { | ||
let status = match signal { | ||
SignalTo::Shutdown => { | ||
emit!(VectorStopped); | ||
tokio::select! { | ||
|
@@ -382,7 +398,9 @@ impl FinishedApplication { | |
}) | ||
} | ||
_ => unreachable!(), | ||
} | ||
}; | ||
drop(openssl_legacy_provider); | ||
status | ||
} | ||
} | ||
|
||
|
@@ -525,3 +543,18 @@ pub fn init_logging(color: bool, format: LogFormat, log_level: &str, rate: u64) | |
); | ||
info!(message = "Log level is enabled.", level = ?level); | ||
} | ||
|
||
/// Load the legacy OpenSSL provider. | ||
/// | ||
/// The returned [Provider] must stay in scope for the entire lifetime of the application, as it | ||
/// will be unloaded when it is dropped. | ||
pub fn load_openssl_legacy_provider() -> Option<Provider> { | ||
warn!(message = "DEPRECATED The openssl legacy provider provides algorithms and key sizes no longer recommended for use."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks! I'll plan to amend this in the v0.32.0 release branch to have a pointer to the upgrade guide I'm putting together there to provide users with more details about what this means and how to opt-in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, let me know if you need any help with the upgrade guide. |
||
Provider::try_load(None, "legacy", true) | ||
.map(|provider| { | ||
info!(message = "Loaded openssl legacy provider."); | ||
provider | ||
}) | ||
.map_err(|error| error!(message = "Failed to load openssl legacy provider.", %error)) | ||
.ok() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed once a new version of the upstream is published (alexcrichton/openssl-src-rs#205).