Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src,build: add --openssl-default-cipher-list #33708

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@
"e.g. /root/x/y.js will be referenced via require('root/x/y'). "
"Can be used multiple times")

parser.add_option('--openssl-default-cipher-list',
action='store',
dest='openssl_default_cipher_list',
help='Use the specified cipher list as the default cipher list')

parser.add_option("--openssl-no-asm",
action="store_true",
dest="openssl_no_asm",
Expand Down Expand Up @@ -1311,6 +1316,9 @@ def without_ssl_error(option):
variables['node_without_node_options'] = b(options.without_node_options)
if options.without_node_options:
o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
if options.openssl_default_cipher_list:
variables['openssl_default_cipher_list'] = \
options.openssl_default_cipher_list

if not options.shared_openssl and not options.openssl_no_asm:
is_x86 = 'x64' in variables['target_arch'] or 'ia32' in variables['target_arch']
Expand Down
6 changes: 6 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@

'variables': {
'openssl_system_ca_path%': '',
'openssl_default_cipher_list%': '',
},

'defines': [
Expand All @@ -763,6 +764,11 @@
'msvs_disabled_warnings!': [4244],

'conditions': [
[ 'openssl_default_cipher_list!=""', {
'defines': [
'NODE_OPENSSL_DEFAULT_CIPHER_LIST="<(openssl_default_cipher_list)"'
]
}],
[ 'error_on_warn=="true"', {
'cflags': ['-Werror'],
'xcode_settings': {
Expand Down
6 changes: 5 additions & 1 deletion src/node_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#define RSA_PSS_SALTLEN_AUTO -2
#endif

#if defined(NODE_OPENSSL_DEFAULT_CIPHER_LIST)
#define DEFAULT_CIPHER_LIST_CORE NODE_OPENSSL_DEFAULT_CIPHER_LIST
#else
// TLSv1.3 suites start with TLS_, and are the OpenSSL defaults, see:
// https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_ciphersuites.html
#define DEFAULT_CIPHER_LIST_CORE \
Expand Down Expand Up @@ -68,7 +71,8 @@
"!PSK:" \
"!SRP:" \
"!CAMELLIA"
#endif
#endif // NODE_OPENSSL_DEFAULT_CIPHER_LIST
#endif // HAVE_OPENSSL

namespace node {

Expand Down