Skip to content

Commit 6f696a8

Browse files
author
Till Brehm
committed
Merge branch '6390-use-predefined-dh-params-file-to-speed-up-installation' into 'develop'
Resolve "Use predefined DH params file to speed-up installation" Closes #6390 See merge request ispconfig/ispconfig3!1659
2 parents a9e2f92 + f3f8eb8 commit 6f696a8

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

install/lib/installer_base.lib.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,20 +1600,24 @@ public function configure_dovecot() {
16001600

16011601
// Check if we have a dhparams file and if not, create it
16021602
if(!file_exists('/etc/dovecot/dh.pem')) {
1603+
// Create symlink to ISPConfig dhparam file
1604+
swriteln('Creating symlink /etc/dovecot/dh.pem to ISPConfig DHParam file.');
1605+
symlink('/usr/local/ispconfig/interface/ssl/dhparam4096.pem', '/etc/dovecot/dh.pem');
1606+
1607+
/*
16031608
swriteln('Creating new DHParams file, this takes several minutes. Do not interrupt the script.');
16041609
if(file_exists('/var/lib/dovecot/ssl-parameters.dat')) {
16051610
// convert existing ssl parameters file
16061611
$command = 'dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem';
16071612
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
16081613
} else {
1609-
/*
1610-
Create a new dhparams file. We use 2048 bit only as it simply takes too long
1611-
on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need
1612-
a 4096 bit file, create it manually before you install ISPConfig
1613-
*/
1614+
//Create a new dhparams file. We use 2048 bit only as it simply takes too long
1615+
// on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need
1616+
// a 4096 bit file, create it manually before you install ISPConfig
16141617
$command = 'openssl dhparam -out /etc/dovecot/dh.pem 2048';
16151618
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
16161619
}
1620+
*/
16171621
}
16181622
//remove #2.3+ comment
16191623
$content = file_get_contents($config_dir.'/'.$configfile);
@@ -3319,7 +3323,8 @@ public function make_ispconfig_ssl_cert() {
33193323
// Create symlink to ISPConfig SSL files
33203324
symlink($ssl_pem_file, $pureftpd_pem);
33213325
if (!file_exists("$pureftpd_dir/pure-ftpd-dhparams.pem"))
3322-
exec("cd $pureftpd_dir; openssl dhparam -out dhparam2048.pem 2048; ln -sf dhparam2048.pem pure-ftpd-dhparams.pem");
3326+
symlink('/usr/local/ispconfig/interface/ssl/dhparam4096.pem', $pureftpd_dir.'/pure-ftpd-dhparams.pem');
3327+
//exec("cd $pureftpd_dir; openssl dhparam -out dhparam2048.pem 2048; ln -sf dhparam2048.pem pure-ftpd-dhparams.pem");
33233328
}
33243329
}
33253330

interface/ssl/dhparam4096.pem

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-----BEGIN DH PARAMETERS-----
2+
MIICCAKCAgEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
3+
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
4+
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
5+
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
6+
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
7+
ssbzSibBsu/6iGtCOGEfz9zeNVs7ZRkDW7w09N75nAI4YbRvydbmyQd62R0mkff3
8+
7lmMsPrBhtkcrv4TCYUTknC0EwyTvEN5RPT9RFLi103TZPLiHnH1S/9croKrnJ32
9+
nuhtK8UiNjoNq8Uhl5sN6todv5pC1cRITgq80Gv6U93vPBsg7j/VnXwl5B0rZp4e
10+
8W5vUsMWTfT7eTDp5OWIV7asfV9C1p9tGHdjzx1VA0AEh/VbpX4xzHpxNciG77Qx
11+
iu1qHgEtnmgyqQdgCpGBMMRtx3j5ca0AOAkpmaMzy4t6Gh25PXFAADwqTs6p+Y0K
12+
zAqCkc3OyX3Pjsm1Wn+IpGtNtahR9EGC4caKAH5eZV9q//////////8CAQI=
13+
-----END DH PARAMETERS-----

0 commit comments

Comments
 (0)