diff --git a/install/install.php b/install/install.php index ef8264169a2a6950c7f138d412ec32bf0b1267ea..cdf6806092be0f2d5f81db3468a4e9e8bdb702b8 100644 --- a/install/install.php +++ b/install/install.php @@ -545,6 +545,7 @@ if($conf['apache']['installed'] == true) { } //** Configure ISPConfig :-) +$issue_tried = false; $install_ispconfig_interface_default = ($conf['mysql']['master_slave_setup'] == 'y')?'n':'y'; if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPConfig Web Interface', array('y', 'n'), $install_ispconfig_interface_default,'install_ispconfig_web_interface')) == 'y') { swriteln('Installing ISPConfig'); @@ -571,6 +572,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon if(strtolower($inst->simple_query('Do you want a secure (SSL) connection to the ISPConfig web interface', array('y', 'n'), 'y','ispconfig_use_ssl')) == 'y') { $inst->make_ispconfig_ssl_cert(); + $issue_tried = true; } $inst->install_ispconfig_interface = true; @@ -580,7 +582,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon // Create SSL certs for non-webserver(s)? if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) { - if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y') { + if(!$issue_tried && strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y') { $inst->make_ispconfig_ssl_cert(); } } else { diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index efb161569dc2d0f29d927117c282fd2d400fbc33..9aa48a79750aef90d8814aede028c0e93975de9f 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -2835,12 +2835,18 @@ class installer_base { } swriteln('Using certificate path ' . $acme_cert_dir); + $ip_address_match = false; if(!(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips)))) { swriteln('Server\'s public ip(s) (' . $svr_ip4 . ($svr_ip6 ? ', ' . $svr_ip6 : '') . ') not found in A/AAAA records for ' . $hostname . ': ' . implode(', ', $dns_ips)); + if(strtolower($inst->simple_query('Ignore DNS check and continue to request certificate?', array('y', 'n') , 'n','ignore_hostname_dns')) == 'y') { + $ip_address_match = true; + } + } else { + $ip_address_match = true; } - if ((!@is_dir($acme_cert_dir) || !@file_exists($check_acme_file) || !@file_exists($ssl_crt_file) || md5_file($check_acme_file) != md5_file($ssl_crt_file)) && (($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips)))) { + if ((!@is_dir($acme_cert_dir) || !@file_exists($check_acme_file) || !@file_exists($ssl_crt_file) || md5_file($check_acme_file) != md5_file($ssl_crt_file)) && $ip_address_match == true) { // This script is needed earlier to check and open http port 80 or standalone might fail // Make executable and temporary symlink latest letsencrypt pre, post and renew hook script before install @@ -3003,7 +3009,7 @@ class installer_base { } } } else { - if(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))) { + if($ip_address_match) { // the directory already exists so we have to assume that it was created previously $issued_successfully = true; } diff --git a/install/update.php b/install/update.php index 3107adbb62e517192e918c89e90e27e7b7b176a5..75be8a46ccaf72fef45e4b87890b68d3e371899a 100644 --- a/install/update.php +++ b/install/update.php @@ -519,6 +519,7 @@ if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'sel //** Configure ISPConfig swriteln('Updating ISPConfig'); +$issue_tried = false; // create acme vhost if($conf['nginx']['installed'] == true) { $inst->make_acme_vhost('nginx'); // we need this config file but we don't want nginx to be restarted at this point @@ -541,13 +542,15 @@ if ($inst->install_ispconfig_interface) { // $ispconfig_ssl_default = (is_ispconfig_ssl_enabled() == true)?'y':'n'; if(strtolower($inst->simple_query('Create new ISPConfig SSL certificate', array('yes', 'no'), 'no','create_new_ispconfig_ssl_cert')) == 'yes') { $inst->make_ispconfig_ssl_cert(); + $issue_tried = true; } } // Create SSL certs for non-webserver(s)? if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) { - if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y') + if(!$issue_tried && strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y') { $inst->make_ispconfig_ssl_cert(); + } } else { swriteln('Certificate exists. Not creating a new one.'); }