I need to implement client certificates in our application. The current build of 3.2.2 does not support this and required me to modify a few options in the request setup. Can you please include this in future builds so that the client can specify the following options: passphrase, pfx, ca, key, crt.
Just in case anyone else needs to search this issue: node restler client certificate.
Hi,
I need to implement client certificates in our application. The current build of 3.2.2 does not support this and required me to modify a few options in the request setup. Can you please include this in future builds so that the client can specify the following options: passphrase, pfx, ca, key, crt.
Just in case anyone else needs to search this issue: node restler client certificate.
Thanks
this.request = proto.request({ host: this.url.hostname, port: this.url.port, path: this._fullPath(), method: this.options.method, headers: this.headers, rejectUnauthorized: this.options.rejectUnauthorized, passphrase: this.options.passphrase, pfx: this.options.pfx, ca: this.options.ca, key: this.options.key, cert: this.options.cert });
Example:
options = { key: fs.readFileSync('../path/to/key.key'), cert: fs.readFileSync('../path/to/cert.crt'), ca: [fs.readFileSync('../path/to/clientcert.crt')], passphrase: 'mypass' };
// or
options = { pfx: fs.readFileSync('../path/to/pfx.pfx'), passphrase: 'mypass' }
json = { myData: 'topost' };
url = 'https://myurl.com';
return restler.postJson(url, json, options).on("complete", (function(_this) { return function(resResponse) { console.log(resResponse) }); }; }));