From 065eee5d2ed99d380e4fa9badd2dcdab4b466e33 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Thu, 9 Jan 2025 13:57:12 +0100 Subject: [PATCH] agents: fix grpc insecure opt initialization `OtlpGrpcClientOptions.use_ssl_credentials` is not initialized by default to `false` as it happens with all their children. Make sure it is otherwise it can produce undesired behaviour. PR-URL: https://github.com/nodesource/nsolid/pull/247 Reviewed-By: Rafael Gonzaga --- agents/grpc/src/grpc_agent.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/grpc/src/grpc_agent.cc b/agents/grpc/src/grpc_agent.cc index da4740d068..e8cbc47102 100644 --- a/agents/grpc/src/grpc_agent.cc +++ b/agents/grpc/src/grpc_agent.cc @@ -1037,8 +1037,8 @@ int GrpcAgent::config(const json& config) { opts.endpoint = endpoint; opts.metadata = {{"nsolid-agent-id", agent_id_}, {"nsolid-saas", saas()}}; + opts.use_ssl_credentials = !insecure; if (!insecure) { - opts.use_ssl_credentials = true; if (!custom_certs_.empty()) { opts.ssl_credentials_cacert_as_string = custom_certs_; } else {