From d6c147d62a9aa96f0807e190190a06ed880df07f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 9 Sep 2024 18:57:38 +0200 Subject: [PATCH] feat(NODE-6365): pass through `allowPartialTrustChain` TLS flag (#4228) --- src/cmap/connect.ts | 1 + src/connection_string.ts | 3 ++- src/mongo_client.ts | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cmap/connect.ts b/src/cmap/connect.ts index b2ec3caabf..f15d1096b4 100644 --- a/src/cmap/connect.ts +++ b/src/cmap/connect.ts @@ -249,6 +249,7 @@ export async function prepareHandshakeDocument( /** @public */ export const LEGAL_TLS_SOCKET_OPTIONS = [ + 'allowPartialTrustChain', 'ALPNProtocols', 'ca', 'cert', diff --git a/src/connection_string.ts b/src/connection_string.ts index 758b3a01de..2bf1f6dd19 100644 --- a/src/connection_string.ts +++ b/src/connection_string.ts @@ -1228,7 +1228,8 @@ export const OPTIONS = { // Custom types for modifying core behavior connectionType: { type: 'any' }, srvPoller: { type: 'any' }, - // Accepted NodeJS Options + // Accepted Node.js Options + allowPartialTrustChain: { type: 'any' }, minDHSize: { type: 'any' }, pskCallback: { type: 'any' }, secureContext: { type: 'any' }, diff --git a/src/mongo_client.ts b/src/mongo_client.ts index db16e556c1..e8aae51639 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -93,8 +93,10 @@ export interface PkFactory { /** @public */ export type SupportedTLSConnectionOptions = Pick< - TLSConnectionOptions, - Extract + TLSConnectionOptions & { + allowPartialTrustChain?: boolean; + }, + (typeof LEGAL_TLS_SOCKET_OPTIONS)[number] >; /** @public */