Matteo Collina
69cca8726f
https: isolate Agent TLS policy keys
...
Encode TLS option types and values in HTTPS Agent keys so distinct trust
and identity policies cannot share sockets or cached sessions. Assign
stable identities to opaque SecureContext and callback objects.
Refs: https://hackerone.com/reports/3946081
Assisted-by: codex:gpt-5.6-sol
Signed-off-by: Matteo Collina <hello@matteocollina.com >
PR-URL: https://github.com/nodejs-private/node-private/pull/1036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
CVE-ID: CVE-2026-123877
2026-11-11 17:59:42 +01:00
Filip Skokan
a2cd8aa883
crypto,https,tls: end OpenSSL engine support
...
OpenSSL removed support for engines in version 4. Remove the Node.js
APIs, constants, native bindings, and implementation that depend on
ENGINE.
Keep recognizing the former TLS and HTTPS engine options so their use
fails explicitly instead of appearing to work while being ignored.
Move DEP0183 directly from Documentation-only to End-of-Life after
reverting its unreleased Runtime deprecation.
Signed-off-by: Filip Skokan <panva.ip@gmail.com >
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/64777
Fixes: https://github.com/nodejs/node/issues/56733
Refs: https://github.com/nodejs/node/pull/64211
Refs: https://github.com/nodejs/node/pull/63966
Refs: https://github.com/nodejs/node/pull/53329
Refs: https://github.com/nodejs/node/pull/48950
Refs: https://github.com/nodejs/node/issues/45465
Refs: https://github.com/nodejs/node/issues/42827
Refs: https://github.com/nodejs/node/issues/47076
Refs: https://github.com/nodejs/node/pull/62862
Refs: https://github.com/nodejs/node/pull/38512
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <richard.lau@ibm.com >
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day >
2026-10-25 22:36:38 +01:00
Sebastian Beltran
12ce81920a
lib: deprecate _http_*
...
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58535
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Aviv Keller <me@aviv.sh >
2026-10-15 00:52:34 +00:00
Christian Aurich Zanettini Martins
ada8c5c9f8
https: handle invalid TLS options in proxied requests
...
tls.connect() can throw while validating TLS options. For proxied HTTPS
requests, it is called after the CONNECT response has been received, so
the throw happens asynchronously from the original https.request() call
and ends the process as an uncaught exception.
Catch the error, close the tunnel socket, and propagate it to the
request.
Signed-off-by: Christian Aurich <christian.aurichzm@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/66096
Reviewed-By: Xuguang Mei <meixuguang@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2026-09-20 19:14:24 +00:00
Matteo Collina
84e367579e
https: limit proxy CONNECT response headers
...
Apply the configured maximum header size while reading CONNECT
responses. Rearm the readable listener only once per read pass to avoid
unbounded buffer and listener growth.
Signed-off-by: Matteo Collina <hello@matteocollina.com >
PR-URL: https://github.com/nodejs/node/pull/64545
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2026-09-03 15:56:36 +02:00
Matteo Collina
52a8ace880
https: bind identity checks to session reuse
...
PR-URL: https://github.com/nodejs-private/node-private/pull/904
Refs: https://hackerone.com/reports/3811980
CVE-ID: CVE-2026-58040
2026-07-29 10:41:22 -03:00
RafaelGSS
9f03017f38
https: distinguish PFX object-array agent keys
...
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com >
PR-URL: https://github.com/nodejs-private/node-private/pull/930
Refs: https://hackerone.com/reports/3816840
CVE-ID: CVE-2026-56850
2026-07-29 10:41:14 -03:00
Joyee Cheung
c0108bfc55
http: add http.setGlobalProxyFromEnv()
...
This adds an API to dynamically enable built-in proxy support
for all of fetch() and http.request()/https.request(), so
that users do not have to be aware of them all and configure them
one by one.
PR-URL: https://github.com/nodejs/node/pull/60953
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tim Perry <pimterry@gmail.com >
2025-12-10 16:12:28 +00:00
Joyee Cheung
81af7b93c5
http,https: handle IPv6 with proxies
...
This simplifies the proxy configuration handling code,
adds tests to make sure the proxy support works with IPv6
and throws correct errors for invalid proxy IPs.
Drive-by: remove useless properties from ProxyConfig
PR-URL: https://github.com/nodejs/node/pull/59894
Refs: https://github.com/nodejs/node/issues/57872
Reviewed-By: Aditi Singh <aditisingh1400@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-09-22 23:19:26 +00:00
Joyee Cheung
0259df9faf
cli: add --use-env-proxy
...
This does the same as NODE_USE_ENV_PROXY. When both are set,
like other options that can be configured from both sides,
the CLI flag takes precedence.
PR-URL: https://github.com/nodejs/node/pull/59151
Fixes: https://github.com/nodejs/node/issues/59100
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2025-07-26 20:43:10 +00:00
Yagiz Nizipli
0fd1ecded6
meta: enable jsdoc/check-tag-names rule
...
PR-URL: https://github.com/nodejs/node/pull/58521
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2025-07-18 09:28:21 +00:00
Joyee Cheung
036b1fd66d
http,https: add built-in proxy support in http/https.request and Agent
...
This patch implements proxy support for HTTP and HTTPS clients and
agents in the `http` and `https` built-ins`. When NODE_USE_ENV_PROXY
is set to 1, the default global agent would parse the
HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
settings from the environment variables, and proxy the requests
sent through the built-in http/https client accordingly.
To support this, `http.Agent` and `https.Agent` now accept a few new
options:
- `proxyEnv`: when it's an object, the agent would read and parse
the HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
properties from it, and apply them based on the protocol it uses
to send requests. This option allows custom agents to
reuse built-in proxy support by composing options. Global agents
set this to `process.env` when NODE_USE_ENV_PROXY is 1.
- `defaultPort` and `protocol`: these allow setting of the default port
and protocol of the agents. We also need these when configuring
proxy settings and deciding whether a request should be proxied.
Implementation-wise, this adds a `ProxyConfig` internal class to handle
parsing and application of proxy configurations. The configuration
is parsed during agent construction. When requests are made,
the `createConnection()` methods on the agents would check whether
the request should be proxied. If yes, they either connect to the
proxy server (in the case of HTTP reqeusts) or establish a tunnel
(in the case of HTTPS requests) through either a TCP socket (if the
proxy uses HTTP) or a TLS socket (if the proxy uses HTTPS).
When proxying HTTPS requests through a tunnel, the connection listener
is invoked after the tunnel is established. Tunnel establishment uses
the timeout of the request options, if there is one. Otherwise it uses
the timeout of the agent.
If an error is encountered during tunnel establishment, an
ERR_PROXY_TUNNEL would be emitted on the returned socket. If the proxy
server sends a errored status code, the error would contain an
`statusCode` property. If the error is caused by timeout, the error
would contain a `proxyTunnelTimeout` property.
This implementation honors the built-in socket pool and socket limits.
Pooled sockets are still keyed by request endpoints, they are just
connected to the proxy server instead, and the persistence of the
connection can be maintained as long as the proxy server respects
connection/proxy-connection or persist by default (HTTP/1.1)
PR-URL: https://github.com/nodejs/node/pull/58980
Refs: https://github.com/nodejs/node/issues/57872
Refs: https://github.com/nodejs/node/issues/8381
Refs: https://github.com/nodejs/node/issues/15620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2025-07-18 09:06:32 +02:00
Livia Medeiros
6c9a7cd61e
lib: make ERM functions into wrappers returning undefined
...
PR-URL: https://github.com/nodejs/node/pull/58400
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2025-05-25 13:44:43 +00:00
Livia Medeiros
cfd2021c35
http,https: give names to anonymous or misnamed functions
...
Affected functions:
- http.OutgoingMessage.prototype.cork
- http.OutgoingMessage.prototype.uncork
- http.Server.prototype.close
- http.Server.prototype.closeAllConnections
- http.Server.prototype.closeIdleConnections
- http.Server.prototype[Symbol.asyncDispose]
- http.Server.prototype[nodejs.rejection]
- http.validateHeaderName
- http.validateHeaderValue
- https.Server.prototype.closeAllConnections
- https.Server.prototype.closeIdleConnections
- https.Server.prototype.close
PR-URL: https://github.com/nodejs/node/pull/58180
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-05-12 12:28:05 +00:00
Michaël Zasso
d5eb9a378e
lib: remove Symbol[Async]Dispose polyfills
...
PR-URL: https://github.com/nodejs/node/pull/55276
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-10-07 09:47:44 +00:00
Antoine du Hamel
7c58645aca
lib: move Symbol[Async]Dispose polyfills to internal/util
...
PR-URL: https://github.com/nodejs/node/pull/54853
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-09-10 21:24:56 +00:00
mscdex
71b36b3068
https: only use default ALPNProtocols when appropriate
...
PR-URL: https://github.com/nodejs/node/pull/54411
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-09-01 03:04:10 +00:00
kylo5aby
60ce0783a2
http: fix close return value mismatch between doc and implementation
...
PR-URL: https://github.com/nodejs/node/pull/51797
Fixes: https://github.com/nodejs/node/issues/51787
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-02-26 16:07:39 +00:00
Jungku Lee
6aa7101960
lib: update params in jsdoc for HTTPRequestOptions
...
PR-URL: https://github.com/nodejs/node/pull/49872
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-09-29 13:14:24 +02:00
Paolo Insogna and Luigi Pinca
8490318df8
http: start connections checking interval on listen
...
Co-authored-by: Luigi Pinca <luigipinca@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/48611
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2023-07-24 20:55:19 +00:00
atlowChemi
e8810b91f1
https: server add asyncDispose
...
PR-URL: https://github.com/nodejs/node/pull/48548
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-06-29 11:53:05 +03:00
linkgoron
bd7a8087a5
https: fix connection checking interval not clearing on server close
...
The connection interval should close when httpsServer.close is called
similarly to how it gets cleared when httpServer.close is called.
fixes: https://github.com/nodejs/node/issues/48373
PR-URL: https://github.com/nodejs/node/pull/48383
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-06-12 07:47:25 +00:00
Yagiz Nizipli
e3bb668132
url: offload URLSearchParams initialization
...
PR-URL: https://github.com/nodejs/node/pull/46867
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
2023-03-01 17:03:58 +00:00
Antoine du Hamel
9dbb1623ff
lib: add trailing commas to all public core modules
...
PR-URL: https://github.com/nodejs/node/pull/46848
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2023-02-28 12:10:24 +01:00
Deokjin Kim
391dc74a10
http: throw error if options of http.Server is array
...
If options of http.Server is array, throw ERR_INVALID_ARG_TYPE.
Refs: https://github.com/nodejs/node/pull/24176
PR-URL: https://github.com/nodejs/node/pull/46283
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-01-25 08:52:33 +00:00
Rich Trott
c370ec124c
lib: fix JSDoc issues
...
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.
PR-URL: https://github.com/nodejs/node/pull/45243
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
2022-11-07 07:04:29 +00:00
Paolo Insogna
4267b92604
http: use Keep-Alive by default in global agents
...
PR-URL: https://github.com/nodejs/node/pull/43522
Fixes: https://github.com/nodejs/node/issues/37184
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-29 12:48:52 +02:00
LiviaMedeiros
811cb8f685
https: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-11 12:18:14 +02:00
Shogun
f714a0fa6e
http: added connection closing methods
...
Fixes: https://github.com/nodejs/node/issues/41578
PR-URL: https://github.com/nodejs/node/pull/42812
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-05-03 14:04:07 +02:00
Paolo Insogna
3caa2c1a00
http: refactor headersTimeout and requestTimeout logic
...
PR-URL: https://github.com/nodejs/node/pull/41263
Fixes: https://github.com/nodejs/node/issues/33440
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2022-04-13 15:47:59 +01:00
Rich Trott
3c97583a0d
lib: update JSDoc for linting
...
Fix issue that will be flagged when we update ESLint and dependencies.
PR-URL: https://github.com/nodejs/node/pull/42489
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2022-03-27 08:35:14 -07:00
小菜
04c68ba54a
http: add default argument for Agent.prototype.getName
...
PR-URL: https://github.com/nodejs/node/pull/41906
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ricky Zhou <0x19951125@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
2022-02-27 15:01:01 +00:00
Qingyu Deng
8a8c7f41e1
http,https: align server option of https with http
...
Fixes: https://github.com/nodejs/node/issues/38954
PR-URL: https://github.com/nodejs/node/pull/38992
Refs: https://github.com/nodejs/node/pull/30570
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2021-06-26 14:21:57 +00:00
Voltrex
9a7cbe25de
typings: add JSDoc typings for https
...
Added JSDoc typings for the `https` lib module.
PR-URL: https://github.com/nodejs/node/pull/38589
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-05-24 13:11:50 -07:00
raisinten
295e766c27
lib: remove usage of url.parse
...
Since url.parse() is deprecated, it must not be used inside Node.js.
PR-URL: https://github.com/nodejs/node/pull/36853
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Beth Griggs <bgriggs@redhat.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
2021-02-11 19:30:28 +05:30
zhangyongsheng
7efada695f
url: expose urlToHttpOptions utility
...
PR-URL: https://github.com/nodejs/node/pull/35960
Fixes: https://github.com/nodejs/node/issues/34349
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2021-01-17 17:06:22 +08:00
Antoine du Hamel
aabbf3011b
https: refactor to use more primordials
...
PR-URL: https://github.com/nodejs/node/pull/36195
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2020-12-27 17:30:09 +00:00
Alba Mendez
78d1f8db5d
tls: forward new SecureContext options
...
We have a few places where we individually forward each
parameter to tls.createSecureContext(). In #28973 and others,
we added new SecureContext options but forgot to keep these
places up to date.
As per https.Agent#getName, I understand that at least
`privateKeyIdentifier` and `privateKeyEngine` should be
added too, since they're a substitute for `key`. I've
also added sigalgs.
Fixes: https://github.com/nodejs/node/issues/36322
Refs: https://github.com/nodejs/node/pull/28973
PR-URL: https://github.com/nodejs/node/pull/36416
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-12-12 23:59:58 +01:00
Robert Nagy
5461794b12
https: set requestTimeout default to 0
...
Fixes: https://github.com/nodejs/node/issues/35261
PR-URL: https://github.com/nodejs/node/pull/35264
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-09-21 08:32:26 -07:00
df08d527c2
http: add requestTimeout
...
This commits introduces a new http.Server option called requestTimeout
with a default value in milliseconds of 0.
If requestTimeout is set to a positive value, the server will start a new
timer set to expire in requestTimeout milliseconds when a new connection
is established. The timer is also set again if new requests after the
first are received on the socket (this handles pipelining and keep-alive
cases).
The timer is cancelled when:
1. the request body is completely received by the server.
2. the response is completed. This handles the case where the
application responds to the client without consuming the request body.
3. the connection is upgraded, like in the WebSocket case.
If the timer expires, then the server responds with status code 408 and
closes the connection.
CVE-2020-8251
PR-URL: https://github.com/nodejs-private/node-private/pull/208
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
Co-Authored-By: Paolo Insogna <paolo@cowtech.it >
Co-Authored-By: Robert Nagy <ronagy@icloud.com >
2020-09-15 15:39:54 -04:00
sapics
ee3416b055
lib: replace http to https of comment link urls
...
PR-URL: https://github.com/nodejs/node/pull/34158
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-07-06 07:03:08 -07:00
Brian White
c24b74a7ab
lib: improve debuglog() performance
...
PR-URL: https://github.com/nodejs/node/pull/32260
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-05-30 17:24:43 -04:00
Vighnesh Raut
fa946983cc
https: prevent options object from being mutated
...
Previously, when passing options object to the agent.createConnection
method, the same options object got modified within the method. Now,
any modification will happen on only a copy of the object.
Fixes: https://github.com/nodejs/node/issues/31119
PR-URL: https://github.com/nodejs/node/pull/31151
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-01-03 20:09:27 -08:00
Tim Costa
e17403ede3
http,https: increase server headers timeout
...
Fixes: https://github.com/nodejs/node/issues/24980
Refs: https://github.com/nodejs/node/commit/eb43bc04b1
PR-URL: https://github.com/nodejs/node/pull/30071
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2019-12-14 08:59:19 -05:00
Michaël Zasso
0646eda4fc
lib: flatten access to primordials
...
Store all primordials as properties of the primordials object.
Static functions are prefixed by the constructor's name and prototype
methods are prefixed by the constructor's name followed by "Prototype".
For example: primordials.Object.keys becomes primordials.ObjectKeys.
PR-URL: https://github.com/nodejs/node/pull/30610
Refs: https://github.com/nodejs/node/issues/29766
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-25 10:28:15 +01:00
galina.prokofeva
9a4b16f620
https: change var to let in lib/https.js
...
Changed a variable declaration.
PR-URL: https://github.com/nodejs/node/pull/30320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2019-11-08 15:27:20 -08:00
Ali Ijaz Sheikh
c30ef3cbd2
http, http2: remove default server timeout
...
Timing out and closing the socket after two minutes have elapsed is
surprising and problematic for users. This behavior was specific to
Node.js, and doesn't seem to be common in other language runtimes.
Fixes: https://github.com/nodejs/node/issues/27556
PR-URL: https://github.com/nodejs/node/pull/27558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2019-05-09 08:54:04 -07:00
Michaël Zasso
908292cf1f
lib: enforce the use of Object from primordials
...
PR-URL: https://github.com/nodejs/node/pull/27146
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2019-04-12 05:38:45 +02:00
dnlup
cd3a9eebca
https: remove usage of public require('util')
...
Use `require('internal/util/debuglog').debuglog`
and `Object.setPrototypeOf` instead of `require('util').debuglog`
and `require('util').inherits`.
Refs: https://github.com/nodejs/node/issues/26546
PR-URL: https://github.com/nodejs/node/pull/26772
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-23 18:40:24 +05:30
Sam Roberts
0f8e8f7c6b
tls: introduce client 'session' event
...
OpenSSL has supported async notification of sessions and tickets since
1.1.0 using SSL_CTX_sess_set_new_cb(), for all versions of TLS. Using
the async API is optional for TLS1.2 and below, but for TLS1.3 it will
be mandatory. Future-proof applications should start to use async
notification immediately. In the future, for TLS1.3, applications that
don't use the async API will silently, but gracefully, fail to resume
sessions and instead do a full handshake.
See: https://wiki.openssl.org/index.php/TLS1.3#Sessions
PR-URL: https://github.com/nodejs/node/pull/25831
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2019-02-01 19:06:58 -08:00