You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
{
|
|
my @encryptions = ();
|
|
my $psk_file = ${'zabbix-proxy'}{'TLSPSKFile'} || '/etc/zabbix/zabbix_proxy.psk';
|
|
my $psk_id = ${'zabbix-proxy'}{'TLSPSKIdentity'} || $SystemName . '.' . $DomainName . '-proxy';
|
|
if (-s $psk_file){
|
|
push @encryptions, 'psk';
|
|
$OUT .=<<_EOF;
|
|
TLSPSKFile=$psk_file
|
|
TLSPSKIdentity=$psk_id
|
|
_EOF
|
|
}
|
|
|
|
my $cert = ${'zabbix-proxy'}{'TLSCertFile'} || '/etc/zabbix/zabbix_proxy.crt';
|
|
my $key = ${'zabbix-proxy'}{'TLSKeyFile'} || '/etc/zabbix/zabbix_proxy.key';
|
|
my $ca = ${'zabbix-proxy'}{'TLSCAFile'} || '/etc/zabbix/zabbix_proxy.ca';
|
|
if (-s $cert && -s $key && -s $ca){
|
|
push @encryptions, 'cert';
|
|
$OUT .=<<_EOF;
|
|
TLSCertFile=$cert
|
|
TLSKeyFile=$key
|
|
TLSCAFile=$ca
|
|
_EOF
|
|
my $issuer = ${'zabbix-proxy'}{'TLSServerCertIssuer'} || '';
|
|
my $subject = ${'zabbix-proxy'}{'TLSServerCertSubject'} || '';
|
|
$OUT .= "TLSServerCertIssuer=$issuer\n" if ($issuer ne '');
|
|
$OUT .= "TLSServerCertSubject=$subject\n" if ($subject ne '');
|
|
}
|
|
my $encryptions = (scalar @encryptions > 0) ? join(',', @encryptions) : '';
|
|
$OUT .=<<_EOF if ($encryptions ne '');
|
|
TLSConnect=$encryptions
|
|
TLSAccept=$encryptions
|
|
_EOF
|
|
}
|
|
|