io: removed call to deprecated function
#include <fluent-bit/tls/flb_tls.h>
#include <fluent-bit/flb_socket.h>
#include <fluent-bit/flb_upstream.h>
+#include <fluent-bit/flb_downstream.h>
#include <fluent-bit/flb_utils.h>
#include <fluent-bit/flb_macros.h>
@@ -164,7 +165,8 @@ int flb_io_net_connect(struct flb_connection *connection,
#ifdef FLB_HAVE_TLS
/* Check if TLS was enabled, if so perform the handshake */
if (connection->upstream->flags & FLB_IO_TLS) {
- ret = flb_tls_client_session_create(connection->upstream->tls,
+ if (connection->downstream->tls != NULL) {
+ ret = flb_tls_session_create(connection->upstream->tls,
connection,
coro);
@@ -172,6 +174,7 @@ int flb_io_net_connect(struct flb_connection *connection,
return -1;
}
}
+ }
#endif
flb_trace("[io] connection OK");
