Source
zbx_setproctitle("%s #%d [connecting to the database]", get_process_type_string(process_type), process_num);
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern unsigned char process_type, program_type;
extern int server_num, process_num;
static int connect_to_proxy(const DC_PROXY *proxy, zbx_socket_t *sock, int timeout)
{
int ret = FAIL;
const char *tls_arg1, *tls_arg2;
zabbix_log(LOG_LEVEL_DEBUG, "In %s() address:%s port:%hu timeout:%d conn:%u", __func__, proxy->addr,
proxy->port, timeout, (unsigned int)proxy->tls_connect);
switch (proxy->tls_connect)
{
case ZBX_TCP_SEC_UNENCRYPTED:
tls_arg1 = NULL;
tls_arg2 = NULL;
break;
case ZBX_TCP_SEC_TLS_CERT:
tls_arg1 = proxy->tls_issuer;
tls_arg2 = proxy->tls_subject;
break;
case ZBX_TCP_SEC_TLS_PSK:
tls_arg1 = proxy->tls_psk_identity;
tls_arg2 = proxy->tls_psk;
break;
case ZBX_TCP_SEC_TLS_CERT: