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

473
Views
NodeJs microservice: connection to ElasticSearch

I have in my cluster some microservices that use NestJs and they work perfectly with elasticsearch in https without any certificate. Now I create a NodeJs express microservice where I'm connecting in the same way, but I get always the error

ERROR reloadAllVariables ConnectionError: write EPROTO 140419788733768:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
    at ClientRequest.onError (/app/node_modules/@elastic/elasticsearch/lib/Connection.js:123:16)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  meta: {
    body: null,
    statusCode: null,
    headers: null,
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 3,
      aborted: false
    }
  }
}

using the code:

import { Client } from '@elastic/elasticsearch';
this.client = new Client({
    node: 'https://myhost:9200',
    auth: {
      username: 'elastic',
      password: elasticSecret,
    },
    ssl: {
      rejectUnauthorized: false
    },
});

any suggestion? I won't use the certificate

packages:

"@elastic/elasticsearch": "^7.16.0",
"typescript": "^4.5.2"
"express": "^4.17.1",
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!