Source
static void zbx_tls_validation_error(int type, char **param1, char **param2, const zbx_config_tls_t *config_tls)
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
static zbx_get_program_type_f zbx_get_program_type_cb = NULL;
/******************************************************************************
* *
* Purpose: *
* return the name of a configuration file or command line parameter that *
* the value of the given parameter comes from *
* *
* Parameters: *
* type - [IN] type of parameter (file or command line) *
* param - [IN] address of the parameter variable *
* config_tls - [IN] *
* *
******************************************************************************/
static const char *zbx_tls_parameter_name(int type, char * const *param, const zbx_config_tls_t *config_tls)
{
if (&(config_tls->connect) == param)
return ZBX_TLS_PARAMETER_CONFIG_FILE == type ? "TLSConnect" : "--tls-connect";
if (&(config_tls->accept) == param)
return "TLSAccept";
if (&(config_tls->ca_file) == param)
return ZBX_TLS_PARAMETER_CONFIG_FILE == type ? "TLSCAFile" : "--tls-ca-file";
if (&(config_tls->crl_file) == param)
return ZBX_TLS_PARAMETER_CONFIG_FILE == type ? "TLSCRLFile" : "--tls-crl-file";
if (&(config_tls->server_cert_issuer) == param)
{
if (ZBX_TLS_PARAMETER_CONFIG_FILE == type)
return "TLSServerCertIssuer";
if (0 != (zbx_get_program_type_cb() & ZBX_PROGRAM_TYPE_GET))
return "--tls-agent-cert-issuer";