-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
https agent docs are incomprehensible #10203
Comments
/cc @nodejs/http |
The options passed to
Its probably best to pass options to both the agent and the request If you are just doing a single request, you shouldn't need to create an agent. Some thoughts
|
@nodejs/documentation |
Closing due to lack of participation. I did not check if the docs were updated or not. |
Subsystem: doc,https,http
https://github.com/nodejs/node/blame/d8c7534fcd46283e52c8c9324d11390c6218b809/doc/api/https.md#L195-L232
Docs state that a sub-set of the
tls.connect()
/secure context options can be provided tohttps.request()
.This is almost certainly wrong, probably all of them can be supplied.
The docs then go on to state:
Its impossible to understand what this means... are they options, or not? Do they only work with custom agents?
There is an example.... but since the example passes the exact same options to a custom agent constructor, and to
https.request()
, it gets even harder to understand.It appears that the secure options may not in fact be used as options to
https.request()
... that you need to provide them to an Agent?But none of the optoins provided to the Agent constructor in the example are supported by Agent, according to its docs, including the secure context options, so who knows what they do.
So, at the end of reading through the docs:
I have absolutely no idea what secure context options are supported by https.request(), could be all, could be none as the example suggests.
Maybe the docs are completely wrong, and the only way to provide secure context options with
https.request()
is to use a custom Agent?Or maybe whether the
options
argument tohttps.request()
is ignored when you have an agent, and used when you don't?If anybody knows, feel free to document either here or in a doc PR. I might look at this later, but it wasn't particularly obvious in a quick read.
Also, https://github.com/nodejs/node/blob/master/lib/_http_client.js#L35 is a bit odd, because
null
is explicitly not documented as an option for theagent
property, for http or https. But that's for another issue, I guess.The text was updated successfully, but these errors were encountered: