Conversation
Collaborator
|
Review requested:
|
haramj
force-pushed
the
haramj-patch-260512-1
branch
from
May 13, 2026 05:52
0ac0c7d to
09c23bb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63273 +/- ##
==========================================
+ Coverage 90.35% 90.37% +0.01%
==========================================
Files 790 790
Lines 273773 273783 +10
Branches 52368 52371 +3
==========================================
+ Hits 247374 247432 +58
+ Misses 16908 16845 -63
- Partials 9491 9506 +15
🚀 New features to boost your workflow:
|
haramj
force-pushed
the
haramj-patch-260512-1
branch
from
May 14, 2026 01:50
09c23bb to
8979aad
Compare
haramj
force-pushed
the
haramj-patch-260512-1
branch
2 times, most recently
from
May 15, 2026 16:51
d331383 to
b4ee1f4
Compare
Member
Author
|
@nodejs/startup please take a look at this PR when you have some time? |
Skip directory configuration paths without suppressing errors from actual OpenSSL configuration files. An empty filename avoids reading the same directory again through OPENSSL_CONF. Add coverage for directory paths, malformed configuration files, and command-line configuration precedence. Fixes: nodejs#63256 Signed-off-by: haramjeong <04harams77@gmail.com> Assisted-by: Codex
haramj
force-pushed
the
haramj-patch-260512-1
branch
from
September 25, 2026 14:09
417e9ee to
032c6d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the robustness of Node.js startup when the OPENSSL_CONF environment variable points to a directory instead of a file. Currently, such cases cause a fatal OpenSSL configuration error, preventing Node.js from starting. This change detects directory paths early, emits a descriptive warning, and allows Node.js to continue booting using default settings.
Root Cause Analysis
In src/node.cc, the InitializeOncePerProcessInternal function attempts to load the OpenSSL configuration. If OPENSSL_CONF is set to a directory (e.g., /tmp or C:), OpenSSL's internal fopen() fails, raising a fatal error that triggers an early return and process exit.
Changes
• Pre-check with stat(): Detects if conf_file is a directory before passing it to OpenSSL.
• Cross-platform Compatibility: Implemented directory detection using S_ISDIR and bitwise masks for environments where the macro is unavailable.
• Warning Instead of Exit: Replaced the fatal error exit with a fprintf(stderr, ...) warning to inform the user that the directory path is being ignored.
• Error Queue Management: Ensured the OpenSSL error queue is cleared using ERR_clear_error() to prevent side effects for subsequent operations.
Validation & Testing
I performed a clean build after running make distclean and verified the fix:
$ export OPENSSL_CONF=/tmp
$ ./node --use-system-ca -e "console.log('Final Validation: I am alive!')"
Actual Output:
Warning: OPENSSL_CONF path is a directory; ignoring: /tmp
Final Validation: I am alive!
I ran the full test suite using python3 tools/test.py:
• Passed: 5284 tests.
• Failed: 7 tests (All verified as missing FFI test fixtures, unrelated to this change).
• All parallel/test-crypto-* tests passed successfully.
• Passed make lint-cpp (Ensured all lines are 80 characters or less).
Fixes: #63256