File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ file a new issue.
5252 * [ Build with a specific ICU] ( #build-with-a-specific-icu )
5353 * [ Unix/macOS] ( #unixmacos-3 )
5454 * [ Windows] ( #windows-4 )
55+ * [ Configuring OpenSSL config appname] ( #configure-openssl-appname )
5556* [ Building Node.js with FIPS-compliant OpenSSL] ( #building-nodejs-with-fips-compliant-openssl )
5657* [ Building Node.js with external core modules] ( #building-nodejs-with-external-core-modules )
5758 * [ Unix/macOS] ( #unixmacos-4 )
@@ -768,6 +769,19 @@ as `deps/icu` (You'll have: `deps/icu/source/...`)
768769> .\v cbuild full-icu
769770```
770771
772+ ### Configure OpenSSL appname
773+
774+ Node.js can use an OpenSSL configuration file by specifying the environment
775+ variable ` OPENSSL_CONF ` , or using the command line option ` --openssl-conf ` , and
776+ if none of those are specified will default to reading the default OpenSSL
777+ configuration file ` openssl.cnf ` . Node.js will only read a section that is by
778+ default named ` nodejs_conf ` , but this name can be overridden using the following
779+ configure option:
780+
781+ ``` console
782+ $ ./configure --openssl-conf-name=< some_conf_name>
783+ ```
784+
771785## Building Node.js with FIPS-compliant OpenSSL
772786
773787The current version of Node.js supports FIPS when statically and
Original file line number Diff line number Diff line change 181181 "e.g. /root/x/y.js will be referenced via require('root/x/y'). "
182182 "Can be used multiple times" )
183183
184+ parser .add_argument ("--openssl-conf-name" ,
185+ action = "store" ,
186+ dest = "openssl_conf_name" ,
187+ default = 'nodejs_conf' ,
188+ help = "The OpenSSL config appname (config section name) used by Node.js" )
189+
184190parser .add_argument ('--openssl-default-cipher-list' ,
185191 action = 'store' ,
186192 dest = 'openssl_default_cipher_list' ,
@@ -1488,6 +1494,8 @@ def configure_openssl(o):
14881494 if options .openssl_no_asm :
14891495 variables ['openssl_no_asm' ] = 1
14901496
1497+ o ['defines' ] += ['NODE_OPENSSL_CONF_NAME=' + options .openssl_conf_name ]
1498+
14911499 if options .without_ssl :
14921500 def without_ssl_error (option ):
14931501 error ('--without-ssl is incompatible with %s' % option )
Original file line number Diff line number Diff line change @@ -162,6 +162,9 @@ PVOID old_vectored_exception_handler;
162162struct V8Platform v8_platform;
163163} // namespace per_process
164164
165+ // The section in the OpenSSL configuration file to be loaded.
166+ const char * conf_section_name = STRINGIFY(NODE_OPENSSL_CONF_NAME);
167+
165168#ifdef __POSIX__
166169void SignalExit (int signo, siginfo_t * info, void * ucontext) {
167170 ResetStdio ();
@@ -1085,12 +1088,11 @@ InitializationResult InitializeOncePerProcess(
10851088 // return 0, leading to an endless loop and the node process will appear to
10861089 // hang/freeze.
10871090
1088- // The section in the OpenSSL configuration file to be loaded.
1089- const char * conf_section_name = " nodejs_conf" ;
10901091 // Passing NULL as the config file will allow the default openssl.cnf file
10911092 // to be loaded, but the default section in that file will not be used,
10921093 // instead only the section that matches the value of conf_section_name
10931094 // will be read from the default configuration file.
1095+ // fprintf(stderr, "appanme: %s\n", conf_section_name);
10941096 const char * conf_file = nullptr ;
10951097 // Use OPENSSL_CONF environment variable is set.
10961098 std::string env_openssl_conf;
You can’t perform that action at this time.
0 commit comments