1

I am trying to use greenlock-express to test serving an app with ssl. I am following the documentation here:
So I have app.js:

"use strict";

// Here's a vanilla HTTP app to start,
// but feel free to replace it with Express, Koa, etc
var app = function (req, res) {
  res.end("Hello, Encrypted World!");
};

module.exports = app;

And I have server.js:

"use strict";

var app = require("./app.js");

require("greenlock-express")
  .init({
    packageRoot: __dirname,
    // contact for security and critical bug notices
    maintainerEmail: "my_email@gmail.com",
    // contact for security and critical bug notices
    configDir: "./greenlock.d",

    // whether or not to run at cloudscale
    cluster: false,
  })
  // Serves on 80 and 443
  // Get's SSL certificates magically!
  .serve(app);

I used this command:

npx greenlock init --config-dir ./greenlock.d --maintainer-email 'my_email@gmail.com'

And this command:

npx greenlock add --subject my_website.online --altnames my_website.online

That generated the greenlock.d folder:
enter image description here
config.json

{
  "defaults": {
    "store": {
      "module": "greenlock-store-fs"
    },
    "challenges": {
      "http-01": {
        "module": "acme-http-01-standalone"
      }
    },
    "renewOffset": "-45d",
    "renewStagger": "3d",
    "accountKeyType": "EC-P256",
    "serverKeyType": "RSA-2048",
    "subscriberEmail": "my_email@gmail.com"
  },
  "sites": [
    {
      "subject": "my_website.online",
      "altnames": [
        "my_website.online",
        "www.my_website.online"
      ],
      "renewAt": 1
    }
    
  ]
}

After I run the app on my VPS, this is what gets logged:
enter image description here

However, when I try to access the app, this is what I see:

enter image description here

I followed the exact steps in the tutorial so I do not see why this doesn't work.
Any thoughts?

AG_HIHI
  • 1,705
  • 5
  • 27
  • 69
  • Actually, all I had to do is wait a couple of minutes and the app was online with a secure connection. – AG_HIHI Aug 24 '21 at 08:40

0 Answers0