diff -Nur --no-dereference e-smith-base-5.8.1.old/root/sbin/e-smith/generate-subjectaltnames e-smith-base-5.8.1/root/sbin/e-smith/generate-subjectaltnames --- e-smith-base-5.8.1.old/root/sbin/e-smith/generate-subjectaltnames 2022-07-29 21:53:06.043000000 -0400 +++ e-smith-base-5.8.1/root/sbin/e-smith/generate-subjectaltnames 2022-07-29 21:58:42.462000000 -0400 @@ -17,13 +17,14 @@ #---------------------------------------------------------------------- use esmith::ConfigDB; +use esmith::HostsDB; my $configuration = esmith::ConfigDB->open_ro('configuration') or die "Couldn't open configuration DB\n"; my $domains = esmith::ConfigDB->open_ro('domains') or die "Couldn't open domains DB\n"; -my $hosts = esmith::ConfigDB->open_ro('hosts') +my $hosts = esmith::HostsDB->open_ro() or die "Couldn't open domains DB\n"; my %results_dict = (); @@ -80,14 +81,18 @@ } #---------------------------------------------------------------------- -# Add all domains defined +# Add all hosts per domains defined #---------------------------------------------------------------------- my $AddHosts = $modSSL->prop('AddHosts') || "enabled"; if ( $AddHosts eq "enabled" ) { - foreach my $host ( $hosts->get_all_by_prop(type => 'host') ) + foreach my $domain ($domains->get_all_by_prop(type => 'domain')) #ignore domain-remote { - $results_dict{$host->key} = 1; + foreach my $host ( $hosts->get_hosts_by_domain($domain->key) ) + { + next unless (($host->prop('HostType')||'undef') eq 'Self'); #only define self host + $results_dict{$host->key} = 1; + } } }