Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5909cf3

Browse filesBrowse files
richardlaunodejs-github-bot
authored andcommitted
src: fix dynamically linked OpenSSL version
Report the version of OpenSSL that Node.js is running with instead of the version of OpenSSL that Node.js was compiled against. PR-URL: #53456 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 26f2cbd commit 5909cf3
Copy full SHA for 5909cf3

1 file changed

+5-4Lines changed: 5 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_metadata.cc‎

Copy file name to clipboardExpand all lines: src/node_metadata.cc
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif // NODE_BUNDLED_ZLIB
2424

2525
#if HAVE_OPENSSL
26-
#include <openssl/opensslv.h>
26+
#include <openssl/crypto.h>
2727
#if NODE_OPENSSL_HAS_QUIC
2828
#include <openssl/quic.h>
2929
#endif
@@ -55,9 +55,10 @@ static constexpr size_t search(const char* s, char c, size_t n = 0) {
5555
static inline std::string GetOpenSSLVersion() {
5656
// sample openssl version string format
5757
// for reference: "OpenSSL 1.1.0i 14 Aug 2018"
58-
constexpr size_t start = search(OPENSSL_VERSION_TEXT, ' ') + 1;
59-
constexpr size_t len = search(&OPENSSL_VERSION_TEXT[start], ' ');
60-
return std::string(OPENSSL_VERSION_TEXT, start, len);
58+
const char* version = OpenSSL_version(OPENSSL_VERSION);
59+
const size_t start = search(version, ' ') + 1;
60+
const size_t len = search(&version[start], ' ');
61+
return std::string(version, start, len);
6162
}
6263
#endif // HAVE_OPENSSL
6364

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.