node-vault icon indicating copy to clipboard operation
node-vault copied to clipboard

Connecting to Vault Agent - Error: connect ECONNREFUSED 127.0.0.1:8200

Open Constantin07 opened this issue 6 years ago • 1 comments

I'm connecting to Vault Agent which does auth and token rotation so the client app doesn't need to do auth/token renew manipulations.

Here is the code:

var vault_secret_path = process.env.VAULT_SECRET_PATH;
var options = {
  token: ''
};
var vault = require("node-vault")(options);
var creds;

process.env.VAULT_SKIP_VERIFY = 'true';
vault.read(vault_secret_path)
.then((result) => {
  //console.log(result);
  creds = result.data
})
.catch((err) => console.error(err.message));

but I'm gettig in output:

Error: connect ECONNREFUSED 127.0.0.1:8200

I can connect to the above port without any authentication and read secrets using vault binary.

Does this library support NOT to authenticate with Vault Agent ?

Tried to specify options with an empty token - but no success.

Please could someone give an hint how to skip auth ?

Regards, Constantin

Constantin07 avatar Aug 12 '19 23:08 Constantin07

hi constantin, i am also having the same problem. If you found any solution can you post it here.

Thanks Varun

varun832 avatar Aug 23 '19 06:08 varun832

Hey, no activity since 2019; Please reopen if the issue consists

aviadhahami avatar Nov 10 '22 16:11 aviadhahami

what is the solution to this issue?

I have tried so hard but unable to fix it

Dayo-Adewuyi avatar Mar 16 '23 12:03 Dayo-Adewuyi