-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add tls options #681
add tls options #681
Conversation
It allows arbitrary options, and tls options can override all other properties, e.g. |
This PR works for me, and I also find it concerning that current implementation will happily override any options. At least This is sample naïve code I have used (that's basis upon which I'm building up now): var fs = require('fs');
var request = require('superagent');
var url = 'https://server.local/client_auth';
var myCA = fs.readFileSync('server-ca.crt');
var myCert = fs.readFileSync('client.crt');
var myKey = fs.readFileSync('client.key');
request.get(url).
ca(myCA). // <-- already present
tls({ key: myKey, cert: myCert }). // <-- required to work
end(function(err, res) {
if (err) {
console.log("Err: ", err);
return;
}
console.log(res);
}); |
This approach seems most amicable and forward thinking in the case that the options for I agree that overriding the other options is troublesome, however this could easily be avoided by simply moving the loop above the property assignments which should not be overridden. The only other suggestion would be to add a comment above the method for documentation purposes and maybe a test. |
so that potentially (what i do in my test files)
|
Hi, any news about this? It would be a good feature to add for me. Thanks for the great work. |
This will not be merged in the current state, because it allows change of arbitrary options on the agent, and we don't want to support everything, just properties we know are useful and have tests for.
|
Closed in favor of #1057 If you'd like to add more options, see #681 (comment) |
v5.1.1 released that resolves this issue |
i need use key and cert at self-sign certificate for https