Skip to content

Commit

Permalink
Add CRL_LISTS env var, loads PEM formatted CRLs from /src/main/server…
Browse files Browse the repository at this point in the history
…/crl when enabled
  • Loading branch information
miledivovic committed Oct 20, 2023
1 parent 4422198 commit 0797212
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,17 @@ skyrepoMigrate(function() {
rejectUnauthorized: process.env.CLIENT_SIDE_CERTIFICATE_ONLY == 'true' || false,
allowHTTP1: true,
};
// Load CRL Lists
if (process.env.CRL_LISTS === 'true') {
try {
let paths = glob.sync('./src/main/server/crl/*.pem');
let crls = paths.map(x=>fs.readFileSync(path.resolve(x)));
options.crl = crls;
global.auditLogger.report(global.auditLogger.LogCategory.SYSTEM, global.auditLogger.Severity.INFO, "CRLList", `Loaded CRLs: ${paths}`);
} catch (e) {
global.auditLogger.report(global.auditLogger.LogCategory.SYSTEM, global.auditLogger.Severity.ERROR, "CRLListError", e);
}
}
if (envHttp2) {
global.server = spdy.createServer(options, app).listen(port, after);
} else {
Expand Down

0 comments on commit 0797212

Please sign in to comment.