generate dhparams per server
this way we don't need to save/restore it from the database.
This commit is contained in:
@@ -767,6 +767,13 @@ async function writeDefaultConfig(options) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!fs.existsSync(paths.DHPARAMS_FILE)) {
|
||||
debug('writeDefaultConfig: generating dhparams');
|
||||
const dhparams = safe.child_process.execSync('openssl dhparam -dsaparam 2048');
|
||||
if (!dhparams) throw new BoxError(BoxError.OPENSSL_ERROR, safe.error);
|
||||
if (!safe.fs.writeFileSync(paths.DHPARAMS_FILE, dhparams)) throw new BoxError(BoxError.FS_ERROR, `Could not save dhparams.pem: ${safe.error.message}`);
|
||||
}
|
||||
|
||||
const data = {
|
||||
sourceDir: path.resolve(__dirname, '..'),
|
||||
vhost: '',
|
||||
|
||||
Reference in New Issue
Block a user