Skip to content

Commit e4e7ed2

Browse files
author
thom
committed
Use the correct path to search for the SSL cert (#5719)
1 parent a28d7f1 commit e4e7ed2

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ function update($event_name, $data) {
107107
}
108108
$tpl->setVar('vhost_port_listen', $vhost_port_listen);
109109

110+
/* Check if SSL should be enabled: */
111+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
112+
$tpl->setVar('ssl_comment','');
113+
} else {
114+
$tpl->setVar('ssl_comment','#');
115+
}
116+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.bundle')) {
117+
$tpl->setVar('ssl_bundle_comment','');
118+
} else {
119+
$tpl->setVar('ssl_bundle_comment','#');
120+
}
121+
110122
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
111123
if($mail_config['content_filter'] == 'rspamd'){
112124
$use_rspamd = true;
@@ -127,17 +139,6 @@ function update($event_name, $data) {
127139
$content = str_replace('{apps_vhost_basedir}', $web_config['website_basedir'], $content);
128140
$content = str_replace('{vhost_port_listen}', $vhost_port_listen, $content);
129141
/* end of backwards compatibility section */
130-
/* Check if SSL should be enabled: */
131-
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
132-
$tpl->setVar('ssl_comment','');
133-
} else {
134-
$tpl->setVar('ssl_comment','#');
135-
}
136-
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
137-
$tpl->setVar('ssl_bundle_comment','');
138-
} else {
139-
$tpl->setVar('ssl_bundle_comment','#');
140-
}
141142

142143
$app->system->file_put_contents("$vhost_conf_dir/apps.vhost", $content);
143144

0 commit comments

Comments
 (0)