Skip to content

Commit 3b0fce1

Browse files
committedFeb 20, 2025·
src: gate all quic behind disabled-by-default compile flag
Due to quictls/openssl@93ae85b it is clear that we will need to revert back to using OpenSSL's official releases. This means we will be forced to re-implement at least part of the underlying QUIC implementation to use different crypto APIs. For that reason, this PR disables building any of the QUIC support by default and introduces a new compile time flag. PR-URL: #57142 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 06d5701 commit 3b0fce1

7 files changed

+26
-34
lines changed
 

‎configure.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
sys.path.insert(0, 'tools')
3939
import getmoduleversion
4040
import getnapibuildversion
41-
import getsharedopensslhasquic
4241
from gyp_node import run_gyp
4342
from utils import SearchFiles
4443

@@ -847,6 +846,12 @@
847846

848847
# End dummy list.
849848

849+
parser.add_argument('--with-quic',
850+
action='store_true',
851+
dest='quic',
852+
default=None,
853+
help='build with QUIC support')
854+
850855
parser.add_argument('--without-ssl',
851856
action='store_true',
852857
dest='without_ssl',
@@ -1743,6 +1748,7 @@ def configure_openssl(o):
17431748
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
17441749
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
17451750
variables['openssl_is_fips'] = b(options.openssl_is_fips)
1751+
variables['node_quic'] = b(options.quic)
17461752
variables['node_fipsinstall'] = b(False)
17471753

17481754
if options.openssl_no_asm:
@@ -1804,13 +1810,8 @@ def without_ssl_error(option):
18041810
if options.openssl_is_fips and not options.shared_openssl:
18051811
variables['node_fipsinstall'] = b(True)
18061812

1807-
if options.shared_openssl:
1808-
has_quic = getsharedopensslhasquic.get_has_quic(options.__dict__['shared_openssl_includes'])
1809-
else:
1810-
has_quic = getsharedopensslhasquic.get_has_quic('deps/openssl/openssl/include')
1811-
1812-
variables['openssl_quic'] = b(has_quic)
1813-
if has_quic:
1813+
variables['openssl_quic'] = b(options.quic)
1814+
if options.quic:
18141815
o['defines'] += ['NODE_OPENSSL_HAS_QUIC']
18151816

18161817
configure_library('openssl', o)

‎node.gyp

+5-1
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,16 @@
927927
[ 'node_use_openssl=="true"', {
928928
'sources': [
929929
'<@(node_crypto_sources)',
930-
'<@(node_quic_sources)',
931930
],
932931
'dependencies': [
933932
'deps/ncrypto/ncrypto.gyp:ncrypto',
934933
],
935934
}],
935+
[ 'node_quic=="true"', {
936+
'sources': [
937+
'<@(node_quic_sources)',
938+
],
939+
}],
936940
[ 'OS in "linux freebsd mac solaris" and '
937941
'target_arch=="x64" and '
938942
'node_target_type=="executable"', {

‎src/node_options.cc

+6
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,13 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
443443
true);
444444
AddOption("--experimental-quic",
445445
"" /* undocumented until its development */,
446+
#ifdef NODE_OPENSSL_HAS_QUIC
446447
&EnvironmentOptions::experimental_quic,
448+
#else
449+
// Option is a no-op if the NODE_OPENSSL_HAS_QUIC
450+
// compile flag is not enabled
451+
NoOp{},
452+
#endif
447453
kAllowedInEnvvar);
448454
AddOption("--experimental-webstorage",
449455
"experimental Web Storage API",

‎src/node_options.h

+2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ class EnvironmentOptions : public Options {
127127
bool experimental_websocket = true;
128128
bool experimental_sqlite = true;
129129
bool experimental_webstorage = false;
130+
#ifdef NODE_OPENSSL_HAS_QUIC
130131
bool experimental_quic = false;
132+
#endif
131133
std::string localstorage_file;
132134
bool experimental_global_navigator = true;
133135
bool experimental_global_web_crypto = true;

‎test/common/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const noop = () => {};
5454
const hasCrypto = Boolean(process.versions.openssl) &&
5555
!process.env.NODE_SKIP_CRYPTO;
5656

57-
const hasQuic = hasCrypto && !!process.config.variables.openssl_quic;
57+
const hasQuic = hasCrypto && !!process.config.variables.node_quic;
5858

5959
function parseTestFlags(filename = process.argv[1]) {
6060
// The copyright notice is relatively big and the flags could come afterwards.

‎test/parallel/test-process-env-allowed-flags-are-documented.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ assert(undocumented.delete('--no-verify-base-objects'));
130130
assert(undocumented.delete('--trace-promises'));
131131
assert(undocumented.delete('--no-trace-promises'));
132132
assert(undocumented.delete('--experimental-quic'));
133-
assert(undocumented.delete('--no-experimental-quic'));
133+
if (common.hasQuic) {
134+
assert(undocumented.delete('--no-experimental-quic'));
135+
}
134136

135137
// Remove negated versions of the flags.
136138
for (const flag of undocumented) {

‎tools/getsharedopensslhasquic.py

-23
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.