Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Certificate Support #197

Open
thepatron opened this issue Dec 12, 2014 · 1 comment
Open

Client Certificate Support #197

thepatron opened this issue Dec 12, 2014 · 1 comment

Comments

@thepatron
Copy link

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)
});
};
}));

@geetika-kathuria
Copy link

IS this issue addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants