@@ -2407,7 +2407,7 @@ public function make_ispconfig_ssl_cert() {
24072407 // Check dns a record exist and its ip equal to server public ip
24082408 $ svr_ip = file_get_contents ('http://dynamicdns.park-your-domain.com/getip ' );
24092409 if (checkdnsrr (idn_to_ascii ($ hostname ), 'A ' )) {
2410- $ dns_A =dns_get_record ($ hostname , DNS_A ); $ dns_ip =$ dns_A [0 ][ip];
2410+ $ dns_A =dns_get_record ($ hostname , DNS_A ); $ dns_ip =$ dns_A [0 ][ip];
24112411 }
24122412
24132413 // Check if LE SSL folder for the hostname existed
@@ -2454,22 +2454,22 @@ public function make_ispconfig_ssl_cert() {
24542454 // Build ispserver.pem file and chmod it
24552455 exec ("cat $ ssl_key_file $ ssl_crt_file > $ ssl_pem_file; chmod 600 $ ssl_pem_file " );
24562456 }
2457-
2457+
24582458 if (!@is_dir ($ le_live_dir ) && ($ svr_ip != $ dns_ip )) {
24592459
24602460 // We can still use the old self-signed method
24612461 $ ssl_pw = substr (md5 (mt_rand ()), 0 , 6 );
24622462 exec ("openssl genrsa -des3 -passout pass: $ ssl_pw -out $ ssl_key_file 4096 " );
24632463 if (AUTOINSTALL ){
2464- exec ("openssl req -new -passin pass: $ ssl_pw -passout pass: $ ssl_pw -subj '/C= " .escapeshellcmd ($ autoinstall ['ssl_cert_country ' ])."/ST= " .escapeshellcmd ($ autoinstall ['ssl_cert_state ' ])."/L= " .escapeshellcmd ($ autoinstall ['ssl_cert_locality ' ])."/O= " .escapeshellcmd ($ autoinstall ['ssl_cert_organisation ' ])."/OU= " .escapeshellcmd ($ autoinstall ['ssl_cert_organisation_unit ' ])."/CN= " .escapeshellcmd ($ autoinstall ['ssl_cert_common_name ' ])."' -key $ ssl_key_file -out $ ssl_csr_file " );
2464+ exec ("openssl req -new -passin pass: $ ssl_pw -passout pass: $ ssl_pw -subj '/C= " .escapeshellcmd ($ autoinstall ['ssl_cert_country ' ])."/ST= " .escapeshellcmd ($ autoinstall ['ssl_cert_state ' ])."/L= " .escapeshellcmd ($ autoinstall ['ssl_cert_locality ' ])."/O= " .escapeshellcmd ($ autoinstall ['ssl_cert_organisation ' ])."/OU= " .escapeshellcmd ($ autoinstall ['ssl_cert_organisation_unit ' ])."/CN= " .escapeshellcmd ($ autoinstall ['ssl_cert_common_name ' ])."' -key $ ssl_key_file -out $ ssl_csr_file " );
24652465 } else {
2466- exec ("openssl req -new -passin pass: $ ssl_pw -passout pass: $ ssl_pw -key $ ssl_key_file -out $ ssl_csr_file " );
2466+ exec ("openssl req -new -passin pass: $ ssl_pw -passout pass: $ ssl_pw -key $ ssl_key_file -out $ ssl_csr_file " );
24672467 }
24682468 exec ("openssl req -x509 -passin pass: $ ssl_pw -passout pass: $ ssl_pw -key $ ssl_key_file -in $ ssl_csr_file -out $ ssl_crt_file -days 3650 " );
24692469 exec ("openssl rsa -passin pass: $ ssl_pw -in $ ssl_key_file -out $ ssl_key_file.insecure " );
24702470 rename ($ ssl_key_file , $ ssl_key_file .'.secure ' );
24712471 rename ($ ssl_key_file .'.insecure ' , $ ssl_key_file );
2472- }
2472+ }
24732473 exec ("chown -R root:root $ install_dir/interface/ssl " );
24742474
24752475 }
0 commit comments