-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathpass_request_options.js
More file actions
34 lines (30 loc) · 1000 Bytes
/
pass_request_options.js
File metadata and controls
34 lines (30 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// file: example/pass_request_options.js
process.env.DEBUG = 'node-vault'; // switch on debug mode
// Pass request options at initialization time.
// TLS options (ca, cert, key, passphrase, agentOptions) are mapped to an
// https.Agent and forwarded to axios for every request.
const vault = require('./../src/index')({
requestOptions: {
agentOptions: {
cert: '<path-to-cert>',
key: '<path-to-key>',
passphrase: '<your-passphrase>',
securityOptions: 'SSL_OP_NO_SSLv3',
},
},
});
// You can also pass (or override) request options per-call.
const perCallOptions = {
headers: {
'X-HELLO': 'world',
},
agentOptions: {
cert: '<path-to-cert>',
key: '<path-to-key>',
passphrase: '<your-passphrase>',
securityOptions: 'SSL_OP_NO_SSLv3',
},
};
vault.help('sys/policy', perCallOptions)
.then(() => vault.help('sys/mounts'))
.catch((err) => console.error(err.message));