Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Heroic CMS SSL?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="maxx" data-source="post: 453798" data-attributes="member: 88825"><p>Have any of you managed to get Heroic CMS running with SSL support? According to this <a href="https://github.com/fastify/fastify/issues/355" target="_blank">Github issue</a> you can import fastify this way</p><p></p><p>[code=Javascript]</p><p> const fastify = require('fastify')({</p><p> https: {</p><p> key: fs.readFileSync(path.join(__dirname, 'file.key')),</p><p> cert: fs.readFileSync(path.join(__dirname, 'file.cert'))</p><p> }</p><p> })</p><p>[/code]</p><p></p><p>but after trying it in server.js I just couldn't get it to work. Are there any better way to go about it?</p><p></p><p>Any help is appreciated!</p><p>[automerge]1571093337[/automerge]</p><p>This is what I tried in <strong>web/server.js</strong></p><p></p><p>[code=Javascript]</p><p> static async prepare() {</p><p> // Setup</p><p> HTTP.server = new _fastify2({</p><p> https: {</p><p> key: fs.readFileSync(_path.join(__dirname, 'key.pem')),</p><p> cert: fs.readFileSync(_path.join(__dirname, 'cert.pem'))</p><p> }</p><p> }).default();</p><p> // Configure</p><p> HTTP.server.use((0, _cors2.default)());</p><p> HTTP.server.use(_requestIp2.default.mw());</p><p>[/code]</p><p></p><p>I end up getting:</p><p>[code]</p><p>TypeError: _fastify2 is not a constructor</p><p>[/code]</p><p>[automerge]1571181498[/automerge]</p><p><strong>UPDATE:</strong> 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.</p></blockquote><p></p>
[QUOTE="maxx, post: 453798, member: 88825"] Have any of you managed to get Heroic CMS running with SSL support? According to this [URL='https://github.com/fastify/fastify/issues/355']Github issue[/URL] you can import fastify this way [code=Javascript] const fastify = require('fastify')({ https: { key: fs.readFileSync(path.join(__dirname, 'file.key')), cert: fs.readFileSync(path.join(__dirname, 'file.cert')) } }) [/code] 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! [automerge]1571093337[/automerge] This is what I tried in [B]web/server.js[/B] [code=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()); [/code] I end up getting: [code] TypeError: _fastify2 is not a constructor [/code] [automerge]1571181498[/automerge] [B]UPDATE:[/B] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Heroic CMS SSL?
Top