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

174
Vistas
NodeJS 14+ use RC4-MD5 cipher algorithm with tls native package

I'm working on a project and i need to open tls socket between NodeJS server and a device (http server embedded on electronic card, which operates on a PIC).

This device only support RC4-MD5 encryption algorithm but it's deprecated since Node 9 (I currently working on Node 14.17.5)

How can i implement RC4-MDR5 algorithm in NodeJS without downgrade my node version ?

My code actually:

const tls = require('tls');

let tlsOpts = { // TLS options
  key: fs.readFileSync(path.resolve('dist/assets/cert/privkey.pem')),
  cert: fs.readFileSync(path.resolve('dist/assets/cert/cert.pem')),
  rejectUnauthorized: false,
  ciphers: 'RC4-MD5' // This line throw error: SSL routines:SSL_CTX_set_cipher_list:no cipher match
};

this.server = tls.createServer(tlsOpts, async (socket) => { // Create server
  socket.setEncoding('utf8');
  this.events(socket); // Create event listeners (data, error, close, etc...)
}).listen(this.config.get('TCP_PORT'), () => {
  this.logger.log('TCP server started (port '+this.config.get('TCP_PORT')+')'); // Log server start
});

Edit: To go further, how can i implement my own encryption algorithm and use it with the node tls package ?

Ex:

let tlsOpts = { // TLS options
  key: fs.readFileSync(path.resolve('dist/assets/cert/privkey.pem')),
  cert: fs.readFileSync(path.resolve('dist/assets/cert/cert.pem')),
  rejectUnauthorized: false,
  ciphers: 'My-Custom-Cipher' // Here use my custom algorithm
}

Note: I'm using NestJS framework, that why i have the syntax "this.[...]" in my code.

Thanks.

about 4 years ago · Juan Pablo Isaza
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