Skip to content

Commit

Permalink
Merge branch 'master' into jszwedko/make-openssl-provider-message-mor…
Browse files Browse the repository at this point in the history
…e-verbose
  • Loading branch information
jszwedko authored Aug 17, 2023
2 parents ce0771e + 40f525c commit 1dda479
Show file tree
Hide file tree
Showing 20 changed files with 1,216 additions and 793 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion lib/vector-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chrono-tz = { version = "0.8.3", default-features = false }
encoding_rs = { version = "0.8", default-features = false, features = ["alloc", "serde"] }
indexmap = { version = "2.0", default-features = false, features = ["std"] }
inventory = { version = "0.3" }
no-proxy = { version = "0.3.3", default-features = false, features = ["serialize"] }
no-proxy = { version = "0.3.4", default-features = false, features = ["serialize"] }
num-traits = { version = "0.2.16", default-features = false }
once_cell = { version = "1", default-features = false }
serde = { version = "1.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ metrics = "0.21.1"
metrics-tracing-context = { version = "0.14.0", default-features = false }
metrics-util = { version = "0.15.1", default-features = false, features = ["registry"] }
mlua = { version = "0.8.9", default-features = false, features = ["lua54", "send", "vendored"], optional = true }
no-proxy = { version = "0.3.3", default-features = false, features = ["serialize"] }
no-proxy = { version = "0.3.4", default-features = false, features = ["serialize"] }
once_cell = { version = "1.18", default-features = false }
ordered-float = { version = "3.7.0", default-features = false }
openssl = { version = "0.10.56", default-features = false, features = ["vendored"] }
Expand Down
1 change: 1 addition & 0 deletions scripts/integration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/compose-temp*.yaml
46 changes: 25 additions & 21 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct Application {
pub require_healthy: Option<bool>,
pub config: ApplicationConfig,
pub signals: SignalPair,
pub openssl_legacy_provider: Option<Provider>,
pub openssl_providers: Option<Vec<Provider>>,
}

impl ApplicationConfig {
Expand Down Expand Up @@ -196,11 +196,11 @@ impl Application {
debug!(message = "Disabled probing and configuration of root certificate locations on the system for OpenSSL.");
}

let openssl_legacy_provider = opts
let openssl_providers = opts
.root
.openssl_legacy_provider
.then(load_openssl_legacy_provider)
.flatten();
.then(load_openssl_legacy_providers)
.transpose()?;

let runtime = build_runtime(opts.root.threads, "vector-worker")?;

Expand All @@ -222,7 +222,7 @@ impl Application {
require_healthy: opts.root.require_healthy,
config,
signals,
openssl_legacy_provider,
openssl_providers,
},
))
}
Expand All @@ -239,7 +239,7 @@ impl Application {
require_healthy,
config,
signals,
openssl_legacy_provider,
openssl_providers,
} = self;

let topology_controller = SharedTopologyController::new(TopologyController {
Expand All @@ -257,7 +257,7 @@ impl Application {
graceful_crash_receiver: config.graceful_crash_receiver,
signals,
topology_controller,
openssl_legacy_provider,
openssl_providers,
})
}
}
Expand All @@ -267,7 +267,7 @@ pub struct StartedApplication {
pub graceful_crash_receiver: mpsc::UnboundedReceiver<ShutdownError>,
pub signals: SignalPair,
pub topology_controller: SharedTopologyController,
pub openssl_legacy_provider: Option<Provider>,
pub openssl_providers: Option<Vec<Provider>>,
}

impl StartedApplication {
Expand All @@ -281,7 +281,7 @@ impl StartedApplication {
graceful_crash_receiver,
signals,
topology_controller,
openssl_legacy_provider,
openssl_providers,
} = self;

let mut graceful_crash = UnboundedReceiverStream::new(graceful_crash_receiver);
Expand Down Expand Up @@ -313,7 +313,7 @@ impl StartedApplication {
signal,
signal_rx,
topology_controller,
openssl_legacy_provider,
openssl_providers,
}
}
}
Expand Down Expand Up @@ -368,7 +368,7 @@ pub struct FinishedApplication {
pub signal: SignalTo,
pub signal_rx: SignalRx,
pub topology_controller: SharedTopologyController,
pub openssl_legacy_provider: Option<Provider>,
pub openssl_providers: Option<Vec<Provider>>,
}

impl FinishedApplication {
Expand All @@ -377,7 +377,7 @@ impl FinishedApplication {
signal,
signal_rx,
topology_controller,
openssl_legacy_provider,
openssl_providers,
} = self;

// At this point, we'll have the only reference to the shared topology controller and can
Expand All @@ -392,7 +392,7 @@ impl FinishedApplication {
SignalTo::Quit => Self::quit(),
_ => unreachable!(),
};
drop(openssl_legacy_provider);
drop(openssl_providers);
status
}

Expand Down Expand Up @@ -571,13 +571,17 @@ pub fn init_logging(color: bool, format: LogFormat, log_level: &str, rate: u64)
///
/// 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> {
pub fn load_openssl_legacy_providers() -> Result<Vec<Provider>, ExitCode> {
warn!(message = "DEPRECATED The openssl legacy provider provides algorithms and key sizes no longer recommended for use. Set `--openssl-legacy-provider=false` or `VECTOR_OPENSSL_LEGACY_PROVIDER=false` to disable. See https://vector.dev/highlights/2023-08-15-0-32-0-upgrade-guide/#legacy-openssl for details.");
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()
["legacy", "default"].into_iter().map(|provider_name| {
Provider::try_load(None, provider_name, true)
.map(|provider| {
info!(message = "Loaded openssl provider.", provider = provider_name);
provider
})
.map_err(|error| {
error!(message = "Failed to load openssl provider.", provider = provider_name, %error);
exitcode::UNAVAILABLE
})
}).collect()
}
10 changes: 9 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,15 @@ pub struct RootOpts {
pub allocation_tracing_reporting_interval_ms: u64,

/// Load the OpenSSL legacy provider.
#[arg(long, env = "VECTOR_OPENSSL_LEGACY_PROVIDER", default_value = "true")]
#[arg(
long,
env = "VECTOR_OPENSSL_LEGACY_PROVIDER",
default_value = "true",
default_missing_value = "true",
num_args = 0..=1,
require_equals = true,
action = ArgAction::Set
)]
pub openssl_legacy_provider: bool,

/// Disable probing and configuration of root certificate locations on the system for OpenSSL.
Expand Down
4 changes: 0 additions & 4 deletions src/internal_events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ mod lua;
mod metric_to_log;
#[cfg(feature = "sources-mongodb_metrics")]
mod mongodb_metrics;
#[cfg(feature = "sinks-nats")]
mod nats;
#[cfg(feature = "sources-nginx_metrics")]
mod nginx_metrics;
mod open;
Expand Down Expand Up @@ -224,8 +222,6 @@ pub(crate) use self::loki::*;
pub(crate) use self::lua::*;
#[cfg(feature = "transforms-metric_to_log")]
pub(crate) use self::metric_to_log::*;
#[cfg(feature = "sinks-nats")]
pub(crate) use self::nats::*;
#[cfg(feature = "sources-nginx_metrics")]
pub(crate) use self::nginx_metrics::*;
pub(crate) use self::parser::*;
Expand Down
33 changes: 0 additions & 33 deletions src/internal_events/nats.rs

This file was deleted.

Loading

0 comments on commit 1dda479

Please sign in to comment.