豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 03c36e1

Browse files
sam-githubmhdawson
authored andcommitted
doc: describe OpenSSL maintenance strategy
PR-URL: #677 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 2fc508c commit 03c36e1

File tree

1 file changed

+356
-0
lines changed

1 file changed

+356
-0
lines changed

OpenSSL-Strategy.md

Lines changed: 356 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,356 @@
1+
# Node.js OpenSSL Strategy
2+
3+
This policy document describes for each release line:
4+
5+
* Which versions of OpenSSL Node.js will include.
6+
* Which versions of a "shared" OpenSSL Node.js will support.
7+
* What version of TLS will be supported
8+
- by default,
9+
- with run-time configuration.
10+
* Whether FIPS will be supported.
11+
12+
It also gives background on OpenSSL release lifetimes, TLS1.3, and FIPS support,
13+
as they affect Node.js.
14+
15+
16+
## Node.js version-specific strategy
17+
18+
### Node.js version 4.x (EOL 2018-04-30)
19+
20+
No longer maintained. Not discussed further.
21+
22+
23+
### Node.js versions 6.x (EOL 2019-04-30) and 8.x (EOL 2019-12-31)
24+
25+
Node.js 6.x and 8.x have the same OpenSSL versions and policies.
26+
27+
Node.js 8.x is unusual because it's end-of-life would normally be April, 2020,
28+
but it was moved earlier to conincide with the end-of-life of OpenSSL 1.0.2.
29+
30+
* OpenSSL version: 1.0.2 (kept up-to-date with latest)
31+
* Allowed shared OpenSSL version: 1.0.2x
32+
* Default minimum TLS version is TLSv1, default maximum is TLSv1.2. No other
33+
TLS versions are supported by this version of OpenSSL or Node.js.
34+
* FIPS: supports being configured to build against OpenSSL FIPS 2.0. FIPS
35+
configuration is not default, and OpenSSL FIPS 2.0 is not included in
36+
Node.js.
37+
38+
39+
### Node.js version 10.x (EOL April-2021)
40+
41+
OpenSSL LTS support timing, the lack of OpenSSL LTS planning and the lack of a
42+
clear timeframe for a new FIPS module complicates Node.js 10.
43+
44+
For Node.js < 10.16.0:
45+
* OpenSSL version: 1.1.0
46+
* Allowed shared OpenSSL version: 1.1.0
47+
* Default minimum TLS version is TLSv1, default maximum is TLSv1.2. No other
48+
TLS versions are supported by this version of OpenSSL or Node.js.
49+
* FIPS: not supported
50+
51+
For Node.js >= 10.16.0:
52+
* OpenSSL version: 1.1.1
53+
* Allowed shared OpenSSL version: 1.1.0 or 1.1.1
54+
* Default minimum TLS version is TLSv1, default maximum is TLSv1.2. It is
55+
expected that TLS1.3 support will be backported to 10.x, but it will *not* be
56+
supported by default, only by explicit run-time configuration.
57+
* FIPS: not supported
58+
59+
The plan described above is to:
60+
61+
* Remain backward-compatible with OpenSSL 1.1.0 via dynamic linking for the
62+
lifetime of Node.js 10. This will cease being an _official_ policy at the
63+
OpenSSL 1.1.0 EOL date (2019-09-11), which will occur long before Node.js 10.x
64+
enters Maintenance LTS (April 2020) or EOL (April 2021). Node.js does _not
65+
officially support_ EOL versions of OpenSSL, but support for a shared OpenSSL
66+
1.1.0 will be maintained as long as it does not cause security problems and
67+
there are contributors available to maintain such support. The lack of a
68+
passing test suite with Node.js 10 compiled against OpenSSL 1.1.0 past the
69+
OpenSSL EOL date will not hold up further releases of Node 10.
70+
* Upgrade to OpenSSL 1.1.1 when made generally available and Node.js 10 can
71+
retain ABI and API compatibility. OpenSSL 1.1.1 is claimed by the OpenSSL
72+
project to be API and ABI compatible with 1.1.0, and Node.js experiments
73+
indicates that it is, see
74+
https://github.com/nodejs/node/issues/18770#issuecomment-446785733.
75+
* **No support for FIPS** The latest [OpenSSL 3.0 and FIPS Update][] does not
76+
predict that an OpenSSL 1.1.1 ABI compatible library with FIPS support will
77+
ever exist. Without such a library, Node.js 10.x cannot support FIPS.
78+
79+
This plan must be communicated to users of Node.js 10 early and often. There is
80+
potential for instability and a change in default OpenSSL version is
81+
unprecedented and therefore unexpected. The potential for breaking API and/or
82+
ABI may also cause disruption, potentially requiring an increment of
83+
`NODE_MODULE_VERSION`, which will also be unprecedented within a single release
84+
line. There is no indication yet that this will happen when OpenSSL 1.1.1 is
85+
included in Node.js 10.x, but it is important that users be aware of this
86+
possibility.
87+
88+
89+
### Node.js version 11.x (EOL June-2019)
90+
91+
This release will not be designated LTS. It was updated to include OpenSSL 1.1.1
92+
in [11.9.0](https://nodejs.org/en/blog/release/v11.9.0/).
93+
94+
For Node.js < 11.9.0:
95+
* OpenSSL version: 1.1.0
96+
* Allowed shared OpenSSL version: 1.1.0
97+
* Default minimum TLS version is TLSv1, default maximum is TLSv1.2. No other
98+
TLS versions are supported by this version of OpenSSL or Node.js.
99+
* FIPS: not supported
100+
101+
For Node.js >= 11.9.0:
102+
* OpenSSL version: 1.1.0
103+
* Allowed shared OpenSSL version: 1.1.0 or 1.1.1
104+
* Default minimum TLS version is TLSv1, default maximum is TLSv1.2. It is
105+
expected that TLS1.3 support will be backported to 11.x, but it will *not* be
106+
supported by default, only by explicit run-time configuration.
107+
* FIPS: not supported
108+
109+
110+
### Node.js version master, 12.x (release expected April-2019, EOL April-2022)
111+
112+
* OpenSSL version: 1.1.1
113+
* Allowed shared OpenSSL version: 1.1.1
114+
* Default minimum TLS version is TLSv1.2, default maximum is TLSv1.3. TLSv1
115+
and TLSv1.1 are *not* supported by default, only by explicit run-time
116+
configuration.
117+
* FIPS: not supported
118+
119+
120+
### Node.js version 13.x
121+
122+
It's too early to discuss in detail, but this is the first version that may
123+
possibly support OpenSSL 3.0.0, and OpenSSL 3.0.0 is the next version of OpenSSL
124+
that is planned to support FIPS. See [OpenSSL 3.0.0 and FIPS][].
125+
126+
127+
## Background
128+
129+
The Node.js source tree contains a copy of OpenSSL (as it does all of its
130+
dependencies).
131+
132+
All maintained Node.js release lines are kept up-to-date with the latest OpenSSL
133+
patch release of the OpenSSL version they include.
134+
135+
By default, Node.js compiles and statically links its own copy of OpenSSL. It
136+
can be configured to an external "shared" OpenSSL library, or a non-OpenSSL
137+
library that has a sufficiently OpenSSL-compatible API. See [OpenSSL Forks][]
138+
for more information about OpenSSL-compatible libraries.
139+
140+
Shared OpenSSL libraries will lack our floating patches, and may also not be the
141+
latest OpenSSL patch release. Node.js supports being configured to build against
142+
a shared OpenSSL library. Node.js does *not* support the resulting Node.js
143+
binaries built with this non-default configuration, doing so is the
144+
responsibility of the distributor.
145+
146+
There are different configurations in use by distributors for linking Node.js to
147+
OpenSSL. The most notable distributors and the configurations used are:
148+
149+
* **nodejs.org**: Binaries produced by the Node.js Build infrastructure across
150+
all supported architectures use the default configuration for OpenSSL and
151+
therefore compile and statically link in the OpenSSL source as it ships with
152+
Node.js. It should be noted that nodejs.org is the source of binaries for
153+
**nvm** which is in heavy client use and is also used by Travis-CI to fetch
154+
and install Node.js.
155+
* **Linux Distributions**: Binaries shipped with Debian, Ubuntu, CentOS, RHEL,
156+
Fedora and the majority of other Linux distributions follow a standard policy
157+
of separating dependencies and dynamically linking wherever possible. The
158+
Node.js packages on these systems are linked via the packaging dependency
159+
mechanisms to OpenSSL 1.0.2 packages and the `node` binaries that ship by
160+
default on these platforms use the shared OpenSSL 1.0.2 library installed by
161+
those packages. Therefore, the floating patches do not apply and it is
162+
possible that a different version of OpenSSL 1.0.2 is in use by Node.js than
163+
the version that was shipped in the source tree.
164+
* **NodeSource Builds**: Binaries
165+
[distributed](https://github.com/nodesource/distributions) by NodeSource are
166+
heavily used, and do not follow the Linux distribution policyof dependency
167+
seperation. NodeSource uses the Node.js defaults for `configure` and compile
168+
and statically link in the OpenSSL source shipped bundled with Node.js.
169+
* **Homebrew**: The
170+
[formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/node.rb)
171+
for Node.js as distributed on macOS by the popular `brew` command, by default,
172+
will compile using the default `configure` configuration. It is possible to
173+
override this using a `with-openssl` option which will compile against the
174+
version of OpenSSL that was most recently installed with `brew` but this is
175+
not believed to be in common use.
176+
177+
178+
179+
## OpenSSL release lines
180+
181+
Currently, there are three supported versions of OpenSSL as per the
182+
[OpenSSL Release Strategy][].
183+
184+
* Version 1.0.2: supported until 2019-12-31, designated Long-term Support (LTS)
185+
* Version 1.1.0: supported until 2019-09-11, not a LTS release line
186+
* Version 1.1.1: supported until 2023-09-11, designated Long-term Support (LTS)
187+
188+
### OpenSSL 1.0.2 and FIPS
189+
190+
OpenSSL 1.0.2 is included with Node.js 6.x and 8.x. Those Node.js versions will
191+
continue to get patch updates to 1.0.2, but will not be updated past 1.0.2.
192+
193+
As the 1.0.2 support timeframe does not extend for the entirety of what should
194+
be the support timeframe for Node.js version 8 (2020-04), the version 8.x EOL
195+
date has been [contracted](https://github.com/nodejs/release#release-schedule)
196+
to coincide with the OpenSSL 1.0.2 EOL date at the end of 2019.
197+
198+
[Federal Information Processing Standard](https://en.wikipedia.org/wiki/FIPS_140-2),
199+
"FIPS", is managed by the NIST. Publication 140-2 is a US government standard
200+
used to approve cryptographic software.
201+
202+
Various organizations rely on the FIPS standard and mandate that software that
203+
they use conform appropriately. OpenSSL itself is not FIPS "validated", instead
204+
a separate "software component" called the "OpenSSL FIPS Object Module" has
205+
been created for the purpose of validation. It is a drop-in replacement for
206+
OpenSSL such that software using the OpenSSL API can be adapted to use it. In
207+
order to retain FIPS compliance, the OpenSSL FIPS Object Module source code
208+
must be obtained via a secure path as dictated by a security policy and the
209+
source must be compiled according to specific steps without variation.
210+
211+
Node.js compiled against the OpenSSL FIPS Object Module does not make Node.js
212+
itself FIPS validated. Instructions for compiling Node.js against the Object
213+
Module along with links to further documentation are detailed in
214+
[BUILDING.md](https://github.com/nodejs/node/blob/master/BUILDING.md#building-nodejs-with-fips-compliant-openssl).
215+
216+
The OpenSSL FIPS Object Module is compatible with OpenSSL 1.0.2 and Node.js has
217+
been able to build with this module since 2015, prior to Node.js 4.x. It
218+
requires some modification of the Node.js internals (see `git grep FIPS -- lib/
219+
src/`) for this to work properly.
220+
221+
OpenSSL 1.0.2 is the only current version of OpenSSL that supports FIPS, which
222+
means that Node.js 6.x and 8.x are the only versions of Node.js that currently
223+
support FIPS.
224+
225+
In particular, note that Node.js 10.x, the most recent Node.js LTS release
226+
line, does not and *will not* support FIPS.
227+
228+
Aside from some manual configuration that is
229+
required in order to support GYP builds (instead of the Perl-based Configure
230+
script that OpenSSL ships) as described in
231+
[deps/openssl/doc/UPGRADING.md](https://github.com/nodejs/node/blob/master/deps/openssl/doc/UPGRADING.md),
232+
there are 4 floating patches that are applied on top of the plain OpenSSL 1.0.2
233+
source:
234+
235+
* [c66c3d9fa](https://github.com/nodejs/node/commit/c66c3d9fa3f5bab0bdfe363dd947136cf8a3907f):
236+
`deps: fix openssl assembly error on ia32 win32`. A minor tweak to
237+
deps/openssl/openssl/crypto/perlasm/x86masm.pl to switch the instruction set
238+
referenced in ASM from 486 to 686, only affecting Windows on IA32.
239+
* [42a8de2ac](https://github.com/nodejs/node/commit/42a8de2ac66b6953cbc731fdb0b128b8019643b2):
240+
`deps: fix asm build error of openssl in x86_win32`. A fix for
241+
deps/openssl/openssl/crypto/perlasm/x86masm.pl for ASM produced for Windows on
242+
IA32 as described in
243+
https://mta.openssl.org/pipermail/openssl-dev/2015-February/000651.html
244+
* [2eb170874](https://github.com/nodejs/node/commit/2eb170874aa5e84e71b62caab7ac9792fd59c10f):
245+
`openssl: fix keypress requirement in apps on win32`. A fix for the `openssl`
246+
client application, used by the Node.js test suite, to properly accept stdin
247+
without requiring a physical keyboard. As described in
248+
<http://openssl.6102.n7.nabble.com/PATCH-s-client-Fix-keypress-requirement-with-redirected-input-on-Windows-td46787.html>.
249+
* [664a65969](https://github.com/nodejs/node/commit/664a6596960655e214fef25e74d3285097703e95):
250+
`deps: add -no_rand_screen to openssl s_client`. Adds a `-no_rand_screen`
251+
command line option to the `openssl` client application, used by the Node.js
252+
test suite which skips invocation of the `RAND_screen()` call on Windows in
253+
order to speed up some of the Node.js TLS tests. Use of this can be found in
254+
many of the `test/*/test-{tls,https}-*` test files.
255+
256+
257+
### OpenSSL 1.1.0
258+
259+
OpenSSL 1.1.0 represents a fairly major rework of the codebase, at least in
260+
comparison to its slow evolution until this point. The external API has some
261+
major departures from 1.0.2. However, support for compiling against an external
262+
OpenSSL 1.1.0 library (dynamically linked) was
263+
[added](https://github.com/nodejs/node/pull/16130) to Node.js' master branch in
264+
late 2017.
265+
266+
Even though OpenSSL 1.1.0 is only supported until 2019-09-11, the API shift was
267+
an important stage in Node.js' adaptation.
268+
269+
Openssl 1.1.0 is currently included in Node.js 10.x, but Node.js is expected to
270+
be updated to include OpenSSL 1.1.1 in the upcoming 10.16.0 release.
271+
272+
273+
### OpenSSL 1.1.1
274+
275+
The OpenSSL team has designated 1.1.1 the next LTS line and have made a
276+
commitment that it will remain both API and ABI compatible with OpenSSL 1.1.0,
277+
and will be supported until 2023-09-11. It is the first OpenSSL version to
278+
support TLS 1.3, however Node.js' TLS1.3 support requires at least OpenSSL
279+
1.1.1b.
280+
281+
282+
### OpenSSL 3.0.0 and FIPS
283+
284+
The next release of OpenSSL will be 3.0.0. It is skipping 2.0 because that
285+
version has been used for OpenSSL FIPS. It is a major re-architecting, and while
286+
it is expected to be API compatible with OpenSSL 1.1.1, it is *not* expected to
287+
be ABI compatible, re-compilation will be necessary to upgrade from OpenSSL
288+
1.1.1 to 3.0.0.
289+
290+
OpenSSL 3.0.0 is expected to support FIPS.
291+
292+
See the [OpenSSL 3.0.0 Design][] for more information.
293+
294+
Beta releases of 3.0.0 are expected in Fall, 2019.
295+
296+
Since OpenSSL 3.0.0 is not expected to be ABI compatible with OpenSSL 1.1.1,
297+
Node.js 12.x cannot be updated to it. Whether Node.js 13.x (a non-LTS release)
298+
will be able to include OpenSSL 3.0.0 is currently unknown. It depends on
299+
whether 3.0.0 is ABI compatible with 1.1.1 (it is not expected to be), whether
300+
the Node.js project is willing to make an ABI incompatible update to OpenSSL
301+
within a non-LTS release line, the timing of the OpenSSL 3.0.0 release, and the
302+
timing of FIPS support for OpenSSL 3.0.0, most of which is unknown.
303+
304+
Currently, it appears that Node.js 13.x will be the next version of Node.js that
305+
may possibly support FIPS, and that Node.js 14.x, released in April, 2020 will
306+
be the next LTS candidate that may possibly support FIPS. There will be a gap
307+
between Node.js 8.x going end-of-life in December, 2019, and the next LTS
308+
release of Node.js that supports FIPS coming in April, 2020.
309+
310+
At this point, the gap looks unavoidable.
311+
312+
313+
## OpenSSL forks: LibreSSL and BoringSSL
314+
315+
**Node.js does not officially support compiling against OpenSSL-compatible
316+
libraries** aside from the OpenSSL FIPS Object Module. However, Node.js
317+
welcomes contributions which may improve compatibility where those
318+
contributions are relatively unobtrusive.
319+
320+
### [LibreSSL](https://www.libressl.org/)
321+
322+
[Some work](https://github.com/nodejs/node/pull/9376) has been done to enable
323+
compilation against LibreSSL. Some operating system distributions ship LibreSSL
324+
instead of OpenSSL and therefore require patching of software such as Node.js.
325+
This is already done in practice, external to the Node.js codebase and without
326+
any support from the Node.js core team. Due to the close compatibility between
327+
LibreSSL and OpenSSL, full and unobtrusive support for compiling against
328+
LibreSSL could be landed into the Node.js codebase given developers interested
329+
in completing this task.
330+
331+
Even if such support was to land in the Node.js codebase, the Node.js project
332+
will not commit to officially supporting LibreSSL or even maintaining full
333+
compatibility in an ongoing basis. As is the case for some operating systems
334+
that are not officially supported, ongoing compatibility will need to be
335+
monitored by interested parties who will also need to submit fixes as required.
336+
337+
### [BoringSSL](https://boringssl.googlesource.com/boringssl/)
338+
339+
> Although BoringSSL is an open source project, it is not intended for general
340+
> use, as OpenSSL is. We don't recommend that third parties depend upon it.
341+
> Doing so is likely to be frustrating because there are no guarantees of API
342+
> or ABI stability.
343+
344+
Google have made it clear that BoringSSL is not intended for general use
345+
outside of their own internal needs. Node.js will not officially support
346+
BoringSSL and unless trivially unobtrusive, the Node.js core team is
347+
discouraged from accepting changes that support BoringSSL. The appearance of
348+
support for BoringSSL will send the wrong message to users regarding its
349+
suitability as an OpenSSL replacement and Node.js' willingness to maintain
350+
support.
351+
352+
[Node.js Release Schedule]: https://github.com/nodejs/Release/blob/master/README.md#release-schedule
353+
[OpenSSL Release Strategy]: https://www.openssl.org/policies/releasestrat.html
354+
[OpenSSL 3.0 and FIPS Update]: https://www.openssl.org/blog/blog/2019/02/13/FIPS-update/
355+
[OpenSSL 3.0.0 Design]: https://www.openssl.org/docs/OpenSSL300Design.html
356+

0 commit comments

Comments
 (0)