@@ -8,7 +8,12 @@ import events from 'node:events';
88import path from 'node:path' ;
99import https from 'node:https' ;
1010import stream from 'node:stream/promises' ;
11- import { buildLibmongocryptDownloadUrl , getLibmongocryptPrebuildName , resolveRoot , run } from './utils.mjs' ;
11+ import {
12+ buildLibmongocryptDownloadUrl ,
13+ getLibmongocryptPrebuildName ,
14+ resolveRoot ,
15+ run
16+ } from './utils.mjs' ;
1217
1318async function parseArguments ( ) {
1419 const pkg = JSON . parse ( await fs . readFile ( resolveRoot ( 'package.json' ) , 'utf8' ) ) ;
@@ -72,19 +77,11 @@ export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot, option
7277
7378 const CMAKE_FLAGS = toCLIFlags ( {
7479 /**
75- * We provide crypto hooks from Node.js binding to openssl (so disable system crypto)
76- * TODO: NODE-5455
80+ * We provide crypto hooks from Node.js binding to openssl (so disable **system** crypto)
7781 *
78- * One thing that is not obvious from the build instructions for libmongocrypt
79- * and the Node.js bindings is that the Node.js driver uses libmongocrypt in
80- * DISABLE_NATIVE_CRYPTO aka nocrypto mode, that is, instead of using native
81- * system libraries for crypto operations, it provides callbacks to libmongocrypt
82- * which, in the Node.js addon case, call JS functions that in turn call built-in
83- * Node.js crypto methods.
84- *
85- * That’s way more convoluted than it needs to be, considering that we always
86- * have a copy of OpenSSL available directly, but for now it seems to make sense
87- * to stick with what the Node.js addon does here.
82+ * Node.js ships with openssl statically compiled into the runtime.
83+ * We provide hooks to libmongocrypt that uses Node.js copy of openssl
84+ * instead of the operating system's copy so we build without linking to the system crypto.
8885 */
8986 DDISABLE_NATIVE_CRYPTO : '1' ,
9087 /** A consistent name for the output "library" directory */
@@ -185,9 +182,7 @@ async function buildBindings(args, pkg) {
185182
186183 gypDefines = gypDefines . trim ( ) ;
187184 const prebuildOptions =
188- gypDefines . length > 0
189- ? { env : { ...process . env , GYP_DEFINES : gypDefines } }
190- : undefined ;
185+ gypDefines . length > 0 ? { env : { ...process . env , GYP_DEFINES : gypDefines } } : undefined ;
191186
192187 await run ( 'npm' , [ 'run' , 'prebuild' ] , prebuildOptions ) ;
193188 // Compile Typescript
0 commit comments