GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: add openssl-system-ca-path configure option · nodejs/node@2268d00

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • configure
  • node.gyp
  • src
    • node_crypto.cc
  • test/parallel
    • test-process-config.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎configure‎

Copy file name to clipboardExpand all lines: configure
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ parser.add_option('--openssl-use-def-ca-store',
172172
dest='use_openssl_ca_store',
173173
help='Use OpenSSL supplied CA store instead of compiled-in Mozilla CA copy.')
174174

175+
parser.add_option('--openssl-system-ca-path',
176+
action='store',
177+
dest='openssl_system_ca_path',
178+
help='Use the specified path to system CA (PEM format) in addition to '
179+
'the OpenSSL supplied CA store or compiled-in Mozilla CA copy.')
180+
175181
shared_optgroup.add_option('--shared-http-parser',
176182
action='store_true',
177183
dest='shared_http_parser',
@@ -988,6 +994,8 @@ def configure_openssl(o):
988994
o['variables']['openssl_no_asm'] = 1 if options.openssl_no_asm else 0
989995
if options.use_openssl_ca_store:
990996
o['defines'] += ['NODE_OPENSSL_CERT_STORE']
997+
if options.openssl_system_ca_path:
998+
o['variables']['openssl_system_ca_path'] = options.openssl_system_ca_path
991999
o['variables']['node_without_node_options'] = b(options.without_node_options)
9921000
if options.without_node_options:
9931001
o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,28 @@
234234
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
235235
],
236236

237+
'variables': {
238+
'openssl_system_ca_path%': '',
239+
},
240+
237241
'defines': [
238242
'NODE_ARCH="<(target_arch)"',
239243
'NODE_PLATFORM="<(OS)"',
240244
'NODE_WANT_INTERNALS=1',
241245
# Warn when using deprecated V8 APIs.
242246
'V8_DEPRECATION_WARNINGS=1',
247+
'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"',
243248
],
244249
'conditions': [
245250
[ 'node_shared=="true" and node_module_version!="" and OS!="win"', {
246251
'product_extension': '<(shlib_suffix)',
247252
}]
248253
],
254+
'direct_dependent_settings': {
255+
'defines': [
256+
'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"',
257+
],
258+
},
249259
},
250260
{
251261
'target_name': 'mkssldef',
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ static const char* const root_certs[] = {
124124
#include "node_root_certs.h" // NOLINT(build/include_order)
125125
};
126126

127+
static const char system_cert_path[] = NODE_OPENSSL_SYSTEM_CERT_PATH;
128+
127129
static std::string extra_root_certs_file; // NOLINT(runtime/string)
128130

129131
static X509_STORE* root_cert_store;
@@ -724,6 +726,9 @@ static X509_STORE* NewRootCertStore() {
724726
}
725727

726728
X509_STORE* store = X509_STORE_new();
729+
if (*system_cert_path != '\0') {
730+
X509_STORE_load_locations(store, system_cert_path, nullptr);
731+
}
727732
if (ssl_openssl_cert_store) {
728733
X509_STORE_set_default_paths(store);
729734
} else {
Collapse file

‎test/parallel/test-process-config.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-config.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ if (!fs.existsSync(configPath)) {
2424
let config = fs.readFileSync(configPath, 'utf8');
2525

2626
// Clean up comment at the first line.
27-
config = config.split('\n').slice(1).join('\n').replace(/'/g, '"');
27+
config = config.split('\n').slice(1).join('\n');
28+
config = config.replace(/"/g, '\\"');
29+
config = config.replace(/'/g, '"');
2830
config = JSON.parse(config, function(key, value) {
2931
if (value === 'true') return true;
3032
if (value === 'false') return false;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.