io: respect the downstream tls state in addition to the feature flag
@@ -88,6 +88,7 @@ int flb_io_net_accept(struct flb_connection *connection,
#ifdef FLB_HAVE_TLS
/* Check if TLS was enabled, if so perform the handshake */
if (connection->downstream->flags & FLB_IO_TLS) {
+ if (connection->downstream->tls != NULL) {
ret = flb_tls_session_create(connection->downstream->tls,
connection,
coro);
@@ -98,6 +99,7 @@ int flb_io_net_accept(struct flb_connection *connection,
return -1;
}
}
+ }
#endif
flb_connection_reset_connection_timeout(connection);
