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

185
Views
How to connect React Front end to Node backend with tls/https

I created a server that is set up with https below sample:

const express = require("express");
const fs = require("fs");
const https = require("https");

const app = express();
const port = process.env.PORT || 8000;

var options = {
    key: fs.readFileSync("server.key"),
    cert: fs.readFileSync("server.cert"),
};


app.listen(port);
https.createServer(options, app).listen(8080, function () {
    console.log(
        "Example app listening on port 8080! Go to https://localhost:8080/"
    );
});

this works fine, but I am not sure how to configure React to make proper handshake. I want to secure both as I want to be able to send files from front to back end securely. I tried setting script in package.json to

"start": "set HTTPS=true&&set SSL_CRT_FILE=server.cert&&set SSL_KEY_FILE=server.key&&react-scripts start"

where I copied .cert and .key that I generated for backend. But as I understood I need to set up different ones locally. https://medium.com/@danielgwilson/https-and-create-react-app-3a30ed31c904 I probably misunderstood something about TLS/HTTPS

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!