From 4035ca16c512eac0c58fbb0ba0053b52cd91e437 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 6 Nov 2018 07:38:50 +0100 Subject: [PATCH] lib: add crypto dependant modules cannotUseCache This commit adds JavaScript modules that depend on crypto to the cannotUseCache array. This is to avoid having them compiled when node has been configured --without-ssl which currently fails. PR-URL: https://github.com/nodejs/node/pull/24100 Reviewed-By: Refael Ackermann Reviewed-By: Joyee Cheung Reviewed-By: Richard Lau --- lib/internal/bootstrap/cache.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/internal/bootstrap/cache.js b/lib/internal/bootstrap/cache.js index 6181228b033228..41159d650bc375 100644 --- a/lib/internal/bootstrap/cache.js +++ b/lib/internal/bootstrap/cache.js @@ -52,6 +52,27 @@ if (process.config.variables.v8_enable_inspector !== 1) { if (!hasTracing) { cannotUseCache.push('trace_events'); } +if (!process.versions.openssl) { + cannotUseCache.push('crypto'); + cannotUseCache.push('https'); + cannotUseCache.push('http2'); + cannotUseCache.push('tls'); + cannotUseCache.push('_tls_common'); + cannotUseCache.push('_tls_wrap'); + cannotUseCache.push('internal/crypto/certificate'); + cannotUseCache.push('internal/crypto/cipher'); + cannotUseCache.push('internal/crypto/diffiehellman'); + cannotUseCache.push('internal/crypto/hash'); + cannotUseCache.push('internal/crypto/keygen'); + cannotUseCache.push('internal/crypto/pbkdf2'); + cannotUseCache.push('internal/crypto/random'); + cannotUseCache.push('internal/crypto/scrypt'); + cannotUseCache.push('internal/crypto/sig'); + cannotUseCache.push('internal/crypto/util'); + cannotUseCache.push('internal/http2/core'); + cannotUseCache.push('internal/http2/compat'); + cannotUseCache.push('internal/streams/lazy_transform'); +} module.exports = { cachableBuiltins: Object.keys(NativeModule._source).filter(