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

324
Views
¿Por qué no puedo conectarme a mi localhost con https?

Hola a todos, intento conectar mi proyecto node.js a mi servidor localhost pero no puedo.

Mi código en app.js:

 var bufferkey = require('fs').readFileSync("sslcert/key.pem"); var buffercert = require('fs').readFileSync("sslcert/cert.pem"); MongoClient.connect(config.database, { sslKey: bufferkey, sslCert: buffercert, sslValidate: false //in case of self-generated certificate }, function(err, db) { console.log(err); console.log(db); db.close(); },{ //useNewUrlParser: true, useUnifiedTopology: true }) .then(() => { console.log('Database connected successfully ' + config.database); }).catch(err => { console.log(err); });

config/base de datos.js:

 module.exports = { database: 'mongodb://localhost:27017/gamerforum?ssl=true', secret: 'secrets' }

No tengo ningún error pero ahora no puedo ir al puerto 5000 con https... ¿por qué?

 (node:24186) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. (Use `node --trace-warnings ...` to show where the warning was created) Server started on port 5000 Database connected successfully mongodb://localhost:27017/gamerforum
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!