Skip to content

Commit

Permalink
Optionally wrap TCP stream in a TLS session in TCP driver
Browse files Browse the repository at this point in the history
  • Loading branch information
vruello committed Dec 2, 2024
1 parent 64a593a commit 0b7fb29
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 147 deletions.
9 changes: 4 additions & 5 deletions Cargo.lock

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

15 changes: 12 additions & 3 deletions cli/src/skell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,19 @@ fn get_outputs() -> String {
# driver = "Tcp"
# format = "Raw"
# Tcp driver has the following paramters:
# - addr (required): Hostname or IP Address to send events to
# Tcp driver has the following parameters:
# - host (required): Hostname or IP Address to send events to
# - port (required): Tcp port to send events to
# config = { addr = "localhost", port = 5000 }
# - tls_enabled (optional, defaults to false): wrap the TCP stream in a TLS session.
# Must be set for other tls_ options to take effect
# - tls_certificate_authorities (optional, defaults to undefined): Validate server certificate
# chain against these authorities. You can define multiple files or paths.
# All the certificates will be read and added to the trust store.
# - tls_certificate (optional, defaults to undefined): Path to certificate in PEM format.
# This certificate will be presented to the server.
# - tls_key (optional, defaults to undefined): Path to the private key corresponding to the
# specified certificate (PEM format).
# config = { host = "localhost", port = 5000 }
# Configure a Redis output
Expand Down
11 changes: 9 additions & 2 deletions cli/src/subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,14 @@ fn outputs_add_tcp(matches: &ArgMatches) -> Result<TcpConfiguration> {
.ok_or_else(|| anyhow!("Missing TCP port"))?;

info!("Adding TCP output: {}:{}", addr, port);
Ok(TcpConfiguration::new(addr.clone(), *port))
Ok(TcpConfiguration::new(
addr.clone(),
*port,
false,
Vec::new(),
None,
None,
)?)
}

fn outputs_add_redis(matches: &ArgMatches) -> Result<RedisConfiguration> {
Expand Down Expand Up @@ -1101,4 +1108,4 @@ fn check_subscriptions_ro(settings: &Settings) -> Result<()> {

fn deprecated_cli_warn() {
warn!("Using commands to manage subscriptions and there outputs is deprecated and will be removed in future releases. Use subscription configuration files instead.")
}
}
Loading

0 comments on commit 0b7fb29

Please sign in to comment.