This commit is contained in:
earnolmartin 2023-02-04 19:59:42 -07:00
parent 867a904f13
commit 5ac9be0ff8
2 changed files with 1426 additions and 1 deletions

View file

@ -13636,7 +13636,9 @@ function syncDomains($file='',$domainname='') {
echo "\nUsing Let's Encrypt SSL certificate for domain " . $dom['domainname'] . ".\n";
$dmnNamesToEncrypt = array($dom['domainname']);
$parts = explode(".", $dom['domainname']);
array_push($dmnNamesToEncrypt, "www." . $dom['domainname']); // Add www. as alias for cert
if(count($parts) <= 2 || $this->domainIsCCTLD($dom['domainname'])){
array_push($dmnNamesToEncrypt, "www." . $dom['domainname']); // Add www. as alias for cert
}
$encDomains["domainnames"] = $dmnNamesToEncrypt;
$encDomains["domainpath"] = $dom['homedir'] . "/httpdocs";
$this->getAndUseLetsEncryptCert($encDomains, $this->getClientEmailFromPanelUsername($dom['panelusername']));
@ -15686,5 +15688,26 @@ function array_copy($arr) {
return $newArray;
}
function domainIsCCTLD($domain){
$domain = strtolower($domain);
$finalList = array();
$csv = array_map('str_getcsv', file($this->ehcpInstallPath . '/misc/SLDs.csv'));
foreach($csv as $key => $value){
if(is_array($value) && count($value) == 2){
$finalList[] = strtolower($value[1]);
}else if(!is_array($value)){
$finalList[] = strtolower($value);
}
}
foreach($finalList as $val){
if(endsWith($domain, $val)){
return true;
}
}
return false;
}
}// end class
?>

1402
ehcp/misc/SLDs.csv Normal file

File diff suppressed because it is too large Load diff