HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/webmin/virtual-server/default_cert.cgi
#!/usr/bin/perl
# Move all cert files to the default location

require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
$d && &can_edit_domain($d) && &can_edit_ssl() ||
	&error($text{'defaultcert_ecannot'});
$d->{'ssl_same'} && &error($text{'defaultcert_esame'});

&ui_print_unbuffered_header(&domain_in($d), $text{'defaultcert_title'}, "");

&lock_domain($d);
&obtain_lock_web($d);
@beforecerts = &get_all_domain_service_ssl_certs($d);

foreach my $t ("key", "cert", "ca", "combined", "everything") {
	$deffile = &default_certificate_file($d, $t);
	$desc = $text{'cert_type_'.$t};
	&$first_print(&text('defaultcert_moving', $desc, "<tt>$deffile</tt>"));
	if (&move_website_ssl_file($d, $t, $deffile)) {
		&$second_print($text{'setup_done'});
		}
	else {
		&$second_print($text{'defaultcert_none'});
		}
	}

# Update other services using the cert
&$first_print($text{'cert_updatesvcs'});
&update_all_domain_service_ssl_certs($d, \@beforecerts);
&$second_print($text{'setup_done'});

&run_post_actions();
&save_domain($d);

&release_lock_web($d);
&unlock_domain($d);
&webmin_log("defaultcert", "domain", $d->{'dom'}, $d);

&ui_print_footer("cert_form.cgi?dom=$d->{'id'}", $text{'cert_return'},
		 &domain_footer_link($d),
		 "", $text{'index_return'});