therootcompany / greenlock-express.js

Free SSL and Automatic HTTPS (ACME / Let's Encrypt v2 client) for node.js with Express, Connect, and other middleware systems
https://greenlock.domains
Mozilla Public License 2.0
67 stars 20 forks source link

ERR_SSL_VERSION_OR_CIPHER_MISMATCH #3

Closed eugrro closed 3 years ago

eugrro commented 3 years ago

Hi, i'm trying to follow the tutorial/walkthrough, but I keep getting the following error. I'm not sure what I'm doing wrong. Below is a screenshot and the code I use cipherMismatch


  require("greenlock-express")
    .init({
        packageRoot: __dirname,
        configDir: "./greenlock.d",

        maintainerEmail: "jon@example.com",
        cluster: false
    })
    .ready(httpsWorker);

function httpsWorker(glx) {
    //
    // HTTPS 1.1 is the default
    // (HTTP2 would be the default but... https://github.com/expressjs/express/issues/3388)
    //
    // Get the raw https server:
    var httpsServer = glx.httpsServer(null, function(req, res) {
        res.end("Hello, Encrypted World!");
    });

    httpsServer.listen(443, "0.0.0.0", function() {
        console.info("Listening on ", httpsServer.address());
    });

    // Note:
    // You must ALSO listen on port 80 for ACME HTTP-01 Challenges
    // (the ACME and http->https middleware are loaded by glx.httpServer)
    var httpServer = glx.httpServer();
`
bloodchen commented 3 years ago

You can not use IP address. SSL is for domain certificate. You need to use a domain name and point the domain (or subdomain) to this IP address. Then add it using greenlock.sites.add(...)

eugrro commented 3 years ago

This fixed my issue thanks