Source
static void zbx_tls_validation_error(int type, char **param1, char **param2, const zbx_config_tls_t *config_tls)
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
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";
else
return "--tls-server-cert-issuer";
}