diff --git a/configure b/configure index bf937ca702a550..4cfa1f76ff68f2 100755 --- a/configure +++ b/configure @@ -133,6 +133,11 @@ parser.add_option('--openssl-fips', dest='openssl_fips', help='Build OpenSSL using FIPS canister .o file in supplied folder') +parser.add_option('--openssl-use-def-ca-store', + action='store_true', + dest='use_openssl_ca_store', + help='Use OpenSSL supplied CA store instead of compiled-in Mozilla CA copy.') + shared_optgroup.add_option('--shared-http-parser', action='store_true', dest='shared_http_parser', @@ -927,6 +932,8 @@ def configure_openssl(o): o['variables']['node_use_openssl'] = b(not options.without_ssl) o['variables']['node_shared_openssl'] = b(options.shared_openssl) o['variables']['openssl_no_asm'] = 1 if options.openssl_no_asm else 0 + if options.use_openssl_ca_store: + o['defines'] += ['NODE_OPENSSL_CERT_STORE'] if options.openssl_fips: o['variables']['openssl_fips'] = options.openssl_fips fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips') diff --git a/doc/api/cli.md b/doc/api/cli.md index 2000c2b3334b74..c7165112bcc243 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -257,6 +257,24 @@ Load an OpenSSL configuration file on startup. Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is built with `./configure --openssl-fips`. +### `--use-openssl-ca`, `--use-bundled-ca` + + +Use OpenSSL's default CA store or use bundled Mozilla CA store as supplied by +current NodeJS version. The default store is selectable at build-time. + +Using OpenSSL store allows for external modifications of the store. For most +Linux and BSD distributions, this store is maintained by the distribution +maintainers and system administrators. OpenSSL CA store location is dependent on +configuration of the OpenSSL library but this can be altered at runtime using +environmental variables. + +The bundled CA store, as supplied by NodeJS, is a snapshot of Mozilla CA store +that is fixed at release time. It is identical on all supported platforms. + +See `SSL_CERT_DIR` and `SSL_CERT_FILE`. ### `--icu-data-dir=file`