I've been trying to learn elasticsearch and decided to try to connect it with node.js. I have a elasticsearch running + a index I created named test-idx. I'm following the documentation of elasticsearch to connect and create a document however when I run my code I get 'ConnectionError: self signed certificate in certificate chain' followed by a huge meta object.
const client = new elasticsearch.Client({
node: 'https://localhost:9200',
auth: {
username: 'elastic',
password: '123456'
}
})
client.index({
index: 'test-idx',
document: {
field: 'test123'
}
})
I tried adding when creating the instance of the Client but it didn't seem to help
tls: {
rejectUnauthorized: false
}