Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

361
Views
"ERR_SSL_VERSION_OR_CIPHER_MISMATCH" error when deploying nodejs app in ubuntu 20.04

I'm just trying to do a simple ssl configuration. I've done it many times before. But now I'm getting a awkward error. The SSL certificate is a letsencrypt certificate.

Here is the index.js file

    const express = require("express");
    const server = express();
    const fs = require("fs");
    const mongoose = require("mongoose");
    const http = require("http");
    const https = require("https");
    const posts = require("./routes/posts");

    mongoose
      .connect(process.env.DATABASE_URI)
      .then(() => console.log("connected mongodb"))
      .catch(() => console.log("connection error"));

    server.use(express.static("public"));
    server.use(express.json());
    server.use(express.urlencoded({ extended: true }));
    server.use(cors());


    const privateKey = fs.readFileSync(
        "/etc/letsencrypt/live/domain.com/privkey.pem",
        "utf8"
      );
    const certificate = fs.readFileSync(
        "/etc/letsencrypt/live/domain.com/cert.pem",
        "utf8"
      );
    const ca = fs.readFileSync(
        "/etc/letsencrypt/live/domain.com/chain.pem",
        "utf8"
      );

    const credentials = {
        privateKey,
        certificate,
        ca,
    };

    http.createServer(server).listen(80);

    https.createServer(credentials,server).listen(443)

    server.use("/api/posts", posts);

Http server is successfully responding to requests. But there is an error in https server.

It is here; enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!