Grpc: Use tls config if uri starts with https

Even if no explicit TlsConfig is set.
This commit is contained in:
Christian Kamm 2023-03-16 15:23:08 +01:00
parent d3fec673cf
commit 19ccf2ff19
1 changed files with 7 additions and 1 deletions

View File

@ -403,7 +403,13 @@ pub async fn process_events(
let f = filter_config.clone();
// Make TLS config if configured
let tls_config = grpc_source.tls.as_ref().map(make_tls_config);
let tls_config = grpc_source.tls.as_ref().map(make_tls_config).or_else(|| {
if grpc_source.connection_string.starts_with(&"https") {
Some(ClientTlsConfig::new())
} else {
None
}
});
tokio::spawn(async move {
let mut metric_retries = metrics_sender.register_u64(