Heroic CMS SSL?

maxx

New Member
Oct 11, 2019
19
2
Have any of you managed to get Heroic CMS running with SSL support? According to this you can import fastify this way

JavaScript:
  const fastify = require('fastify')({
    https: {
      key: fs.readFileSync(path.join(__dirname, 'file.key')),
      cert: fs.readFileSync(path.join(__dirname, 'file.cert'))
    }
  })

but after trying it in server.js I just couldn't get it to work. Are there any better way to go about it?

Any help is appreciated!
Post automatically merged:

This is what I tried in web/server.js

JavaScript:
  static async prepare() {
    // Setup
    HTTP.server = new _fastify2({
        https: {
                key: fs.readFileSync(_path.join(__dirname, 'key.pem')),
                cert: fs.readFileSync(_path.join(__dirname, 'cert.pem'))
        }
    }).default();
    // Configure
    HTTP.server.use((0, _cors2.default)());
    HTTP.server.use(_requestIp2.default.mw());

I end up getting:
Code:
TypeError: _fastify2 is not a constructor
Post automatically merged:

UPDATE: Apparently handling SSL in Node is very expensive in terms of performances, so I ended up just creating a nginx reverse-proxy and let nginx handle my SSL certs. Works great and was probably a lot easier too.
 
Last edited:

Users who are viewing this thread

Top