Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda