Skip to content

Commit

Permalink
fix(all): Enable https in place.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jan 27, 2022
1 parent b116026 commit 1c26466
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,12 @@ export class GBServer {
}
})();
};
if (process.env.ENABLE_HTTPS) {
const sslOptions = {
key: fs.readFileSync('certificates/gb.key', 'utf8'),
cert: fs.readFileSync('certificates/gb.crt', 'utf8'),
ca: fs.readFileSync('certificates/gb-ca.crt', 'utf8'),
if (process.env.CERTIFICATE_PFX) {
var options = {
pfx: fs.readFileSync(process.env.CERTIFICATE_PFX),
passphrase: process.env.CERTIFICATE_PASSPHRASE
};

https.createServer(sslOptions, server).listen(port);
https.createServer(options, server).listen(port, mainCallback);
}
else {
server.listen(port, mainCallback);
Expand Down

0 comments on commit 1c26466

Please sign in to comment.