Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
How to know if the key and certificate are using?

I'm working on the Express API Javascript code in a way that uses the self-signed SSL certificate.

I created a self-signed SSL certificate using: https://helpcenter.gsx.com/hc/en-us/articles/115015960428-How-to-Generate-a-Self-Signed-Certificate-and-Private-Key-using-OpenSSL

Then, I put the privateKey.key, certificate.crt, and server.js in the same folder.

Server.js

const express = require("express");
const fs = require("fs");
const app = express();
const port = 443;

app.get("/", (req, res) => {
  res.send("IT'S WORKING!");
});

require("http")
  .createServer(
    {
      key: fs.readFileSync("privateKey.key"),
      cert: fs.readFileSync("certificate.crt"),
    },
    app
  )
  .listen(port, () => {
    console.log(`Listening on port ${port}!`);
  });

I ran nodemon server.js in terminal and below is the output:

[nodemon] 2.0.12
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
Listening on port 443!

I tested it in the browser by localhost:443. Then the response IT'S WORKING showed up.

My question is Am I doing correctly to the Express API Javascript code with the self-signed SSL certificate? How to know exactly the self-signed SSL certificate is being used?

Thank you so much

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use Wireshark to capture the client's and server's handshake data. Your SSL certificate should be in one of the server's responses data.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda