Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/improvement/ARSN-433/keepAlive' …
Browse files Browse the repository at this point in the history
…into w/8.1/improvement/ARSN-433/keepAlive
  • Loading branch information
nicolas2bert committed Sep 30, 2024
2 parents 7d6c125 + 7ea2502 commit bbf3244
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/network/kmsAWS/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import errors from '../../errors';
import { arsenalErrorAWSKMS } from '../utils'
import { Agent } from 'https';
import { Agent as HttpAgent } from 'http';
import { Agent as HttpsAgent } from 'https';
import { KMS, AWSError } from 'aws-sdk';
import * as werelogs from 'werelogs';
import assert from 'assert';
Expand Down Expand Up @@ -38,15 +39,20 @@ export default class Client {
const { tls, ak, sk, region, endpoint } = options.kmsAWS;

const httpOptions = tls ? {
agent: new Agent({
agent: new HttpsAgent({
keepAlive: true,
rejectUnauthorized: tls.rejectUnauthorized,
ca: tls.ca,
cert: tls.cert,
minVersion: tls.minVersion,
maxVersion: tls.maxVersion,
key: tls.key,
}),
} : undefined;
} : {
agent: new HttpAgent({
keepAlive: true,
}),
};

const credentials = (ak && sk) ? {
credentials: {
Expand Down

0 comments on commit bbf3244

Please sign in to comment.