Skip to content

Commit bbc5e6a

Browse files
committed
Align send API CA trust option with latest Mockttp
1 parent e22142e commit bbc5e6a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/client/client-types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ export interface RequestOptions {
5353
* Each certificate should be an object with a `cert` key containing the PEM
5454
* certificate as a string.
5555
*/
56+
additionalTrustedCAs: Array<{ cert: string }>;
57+
58+
/**
59+
* Deprecated alias for `additionalTrustedCAs`
60+
*
61+
* @deprecated
62+
*/
5663
trustAdditionalCAs?: Array<{ cert: string }>;
5764

5865
/**

src/client/http-client.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export class HttpClient {
8484
effectivePort,
8585
options.ignoreHostHttpsErrors ?? []
8686
);
87-
const caConfig = this.getCaConfig(options.trustAdditionalCAs);
87+
const caConfig = this.getCaConfig(
88+
options.additionalTrustedCAs ||
89+
options.trustAdditionalCAs
90+
);
8891

8992
const agent = await getAgent({
9093
protocol: url.protocol as 'http:' | 'https:',

0 commit comments

Comments
 (0)