backend-test-tools 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/generateImageBuffer.d.ts +2 -3
- package/dist/generators/generateImageBuffer.js +24 -14
- package/dist/generators/generateImageBuffer.js.map +1 -1
- package/dist/utils/tlsRequest.d.ts +2 -2
- package/dist/utils/tlsRequest.js +4 -0
- package/dist/utils/tlsRequest.js.map +1 -1
- package/package.json +36 -38
- package/src/generators/generateImageBuffer.ts +27 -16
- package/src/utils/tlsRequest.ts +7 -3
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function generateImageBuffer(options?: generateImageBufferOptions): Promise<Buffer>;
|
|
1
|
+
/** Generate a random image buffer */
|
|
2
|
+
export declare function generateRandomImageBuffer(width?: number, height?: number): Promise<Buffer>;
|
|
@@ -4,20 +4,30 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var
|
|
9
|
-
/** Generate a
|
|
10
|
-
async function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
exports.generateRandomImageBuffer = generateRandomImageBuffer;
|
|
8
|
+
var _sharp = _interopRequireDefault(require("sharp"));
|
|
9
|
+
/** Generate a random image buffer */
|
|
10
|
+
async function generateRandomImageBuffer(width = 150, height = 150) {
|
|
11
|
+
// Create a blank image buffer
|
|
12
|
+
const buffer = Buffer.alloc(width * height * 3); // RGB buffer (no alpha channel)
|
|
13
|
+
|
|
14
|
+
// Fill the buffer with random colors
|
|
15
|
+
for (let i = 0; i < buffer.length; i += 3) {
|
|
16
|
+
buffer[i] = Math.floor(Math.random() * 256); // Red
|
|
17
|
+
buffer[i + 1] = Math.floor(Math.random() * 256); // Green
|
|
18
|
+
buffer[i + 2] = Math.floor(Math.random() * 256); // Blue
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Use sharp to create an image from the buffer and convert it to PNG
|
|
22
|
+
const imageBuffer = await (0, _sharp.default)(buffer, {
|
|
23
|
+
raw: {
|
|
24
|
+
width: width,
|
|
25
|
+
height: height,
|
|
26
|
+
channels: 3 // RGB
|
|
27
|
+
}
|
|
28
|
+
}).toFormat('png') // Convert to PNG format
|
|
29
|
+
.toBuffer(); // Return the image buffer
|
|
14
30
|
|
|
15
|
-
|
|
16
|
-
async function generateImage(options = {}) {
|
|
17
|
-
return new Promise(resolve => {
|
|
18
|
-
new _jimp.default(options.width ?? 150, options.height ?? 150, function (err, image) {
|
|
19
|
-
resolve(image);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
31
|
+
return imageBuffer;
|
|
22
32
|
}
|
|
23
33
|
//# sourceMappingURL=generateImageBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateImageBuffer.js","names":["
|
|
1
|
+
{"version":3,"file":"generateImageBuffer.js","names":["_sharp","_interopRequireDefault","require","generateRandomImageBuffer","width","height","buffer","Buffer","alloc","i","length","Math","floor","random","imageBuffer","sharp","raw","channels","toFormat","toBuffer"],"sources":["../../src/generators/generateImageBuffer.ts"],"sourcesContent":["import sharp from 'sharp';\n\n/** Generate a random image buffer */\nexport async function generateRandomImageBuffer(\n width: number = 150,\n height: number = 150\n): Promise<Buffer> {\n // Create a blank image buffer\n const buffer = Buffer.alloc(width * height * 3); // RGB buffer (no alpha channel)\n\n // Fill the buffer with random colors\n for (let i = 0; i < buffer.length; i += 3) {\n buffer[i] = Math.floor(Math.random() * 256); // Red\n buffer[i + 1] = Math.floor(Math.random() * 256); // Green\n buffer[i + 2] = Math.floor(Math.random() * 256); // Blue\n }\n\n // Use sharp to create an image from the buffer and convert it to PNG\n const imageBuffer = await sharp(buffer, {\n raw: {\n width: width,\n height: height,\n channels: 3 // RGB\n }\n })\n .toFormat('png') // Convert to PNG format\n .toBuffer(); // Return the image buffer\n\n return imageBuffer;\n}"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACO,eAAeC,yBAAyBA,CAC7CC,KAAa,GAAG,GAAG,EACnBC,MAAc,GAAG,GAAG,EACH;EACjB;EACA,MAAMC,MAAM,GAAGC,MAAM,CAACC,KAAK,CAACJ,KAAK,GAAGC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;;EAEjD;EACA,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,MAAM,CAACI,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;IACzCH,MAAM,CAACG,CAAC,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAK;IACjDP,MAAM,CAACG,CAAC,GAAG,CAAC,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACjDP,MAAM,CAACG,CAAC,GAAG,CAAC,CAAC,GAAGE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;EACnD;;EAEA;EACA,MAAMC,WAAW,GAAG,MAAM,IAAAC,cAAK,EAACT,MAAM,EAAE;IACtCU,GAAG,EAAE;MACHZ,KAAK,EAAEA,KAAK;MACZC,MAAM,EAAEA,MAAM;MACdY,QAAQ,EAAE,CAAC,CAAC;IACd;EACF,CAAC,CAAC,CACCC,QAAQ,CAAC,KAAK,CAAC,CAAC;EAAA,CAChBC,QAAQ,CAAC,CAAC,CAAC,CAAC;;EAEf,OAAOL,WAAW;AACpB","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Agent } from 'supertest';
|
|
2
2
|
import { tlsRequestOptions } from './tlsRequest.types';
|
|
3
3
|
/**
|
|
4
4
|
* Wrapper for supertest that adds TLS encryption
|
|
5
5
|
*/
|
|
6
|
-
export declare function tlsRequest(options?: tlsRequestOptions): Promise<
|
|
6
|
+
export declare function tlsRequest(options?: tlsRequestOptions): Promise<Agent>;
|
package/dist/utils/tlsRequest.js
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.tlsRequest = tlsRequest;
|
|
8
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
9
9
|
var _supertest = require("supertest");
|
|
10
|
+
// Import Agent type
|
|
11
|
+
|
|
10
12
|
const customAgent = (0, _supertest.agent)(`https://localhost:${process.env.PORT}`);
|
|
11
13
|
let settings;
|
|
12
14
|
|
|
@@ -19,6 +21,8 @@ async function tlsRequest(options = {}) {
|
|
|
19
21
|
const key = options.key ? _fs.default.readFileSync(options.key, 'utf-8') : settings.key;
|
|
20
22
|
const cert = options.cert ? _fs.default.readFileSync(options.cert, 'utf-8') : settings.cert;
|
|
21
23
|
if (!ca || !key || !cert) throw new Error('Missing some TLS configuration');
|
|
24
|
+
|
|
25
|
+
// Return Agent with configured TLS options
|
|
22
26
|
return customAgent.ca(ca).key(key).cert(cert);
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tlsRequest.js","names":["_fs","_interopRequireDefault","require","_supertest","customAgent","agent","process","env","PORT","settings","tlsRequest","options","loadDefaultSettings","ca","fs","readFileSync","key","cert","Error","TLS_REQUEST_KEY","TLS_REQUEST_CERT","TLS_REQUEST_CA","TLS_SERVER_KEY","TLS_SERVER_CERT","TLS_CA"],"sources":["../../src/utils/tlsRequest.ts"],"sourcesContent":["import fs from 'fs';\nimport {agent,
|
|
1
|
+
{"version":3,"file":"tlsRequest.js","names":["_fs","_interopRequireDefault","require","_supertest","customAgent","agent","process","env","PORT","settings","tlsRequest","options","loadDefaultSettings","ca","fs","readFileSync","key","cert","Error","TLS_REQUEST_KEY","TLS_REQUEST_CERT","TLS_REQUEST_CA","TLS_SERVER_KEY","TLS_SERVER_CERT","TLS_CA"],"sources":["../../src/utils/tlsRequest.ts"],"sourcesContent":["import fs from 'fs';\nimport { agent, Agent } from 'supertest'; // Import Agent type\nimport { tlsRequestOptions } from './tlsRequest.types';\n\nconst customAgent = agent(`https://localhost:${process.env.PORT as string}`);\n\nlet settings: tlsRequestOptions;\n\n/**\n * Wrapper for supertest that adds TLS encryption\n */\nexport async function tlsRequest(options: tlsRequestOptions = {}): Promise<Agent> {\n if (!settings) loadDefaultSettings();\n \n const ca = options.ca ? fs.readFileSync(options.ca, 'utf-8') : settings.ca;\n const key = options.key ? fs.readFileSync(options.key, 'utf-8') : settings.key;\n const cert = options.cert ? fs.readFileSync(options.cert, 'utf-8') : settings.cert;\n\n if (!ca || !key || !cert) throw new Error('Missing some TLS configuration');\n\n // Return Agent with configured TLS options\n return customAgent.ca(ca).key(key).cert(cert);\n}\n\n/** Load TLS settings from env variables */\nfunction loadDefaultSettings(): void {\n const {\n TLS_REQUEST_KEY,\n TLS_REQUEST_CERT,\n TLS_REQUEST_CA,\n TLS_SERVER_KEY,\n TLS_SERVER_CERT,\n TLS_CA,\n } = process.env;\n\n if (!(TLS_REQUEST_KEY || TLS_SERVER_KEY)) {\n throw new Error('TLS Request: no TLS setting specified');\n }\n\n settings = {\n key: fs.readFileSync((TLS_REQUEST_KEY ?? TLS_SERVER_KEY) as string, 'utf-8'),\n cert: fs.readFileSync((TLS_REQUEST_CERT ?? TLS_SERVER_CERT) as string, 'utf-8'),\n ca: fs.readFileSync((TLS_REQUEST_CA ?? TLS_CA) as string, 'utf-8'),\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA2C;;AAG3C,MAAME,WAAW,GAAG,IAAAC,gBAAK,EAAC,qBAAqBC,OAAO,CAACC,GAAG,CAACC,IAAI,EAAY,CAAC;AAE5E,IAAIC,QAA2B;;AAE/B;AACA;AACA;AACO,eAAeC,UAAUA,CAACC,OAA0B,GAAG,CAAC,CAAC,EAAkB;EAChF,IAAI,CAACF,QAAQ,EAAEG,mBAAmB,CAAC,CAAC;EAEpC,MAAMC,EAAE,GAAGF,OAAO,CAACE,EAAE,GAAGC,WAAE,CAACC,YAAY,CAACJ,OAAO,CAACE,EAAE,EAAE,OAAO,CAAC,GAAGJ,QAAQ,CAACI,EAAE;EAC1E,MAAMG,GAAG,GAAGL,OAAO,CAACK,GAAG,GAAGF,WAAE,CAACC,YAAY,CAACJ,OAAO,CAACK,GAAG,EAAE,OAAO,CAAC,GAAGP,QAAQ,CAACO,GAAG;EAC9E,MAAMC,IAAI,GAAGN,OAAO,CAACM,IAAI,GAAGH,WAAE,CAACC,YAAY,CAACJ,OAAO,CAACM,IAAI,EAAE,OAAO,CAAC,GAAGR,QAAQ,CAACQ,IAAI;EAElF,IAAI,CAACJ,EAAE,IAAI,CAACG,GAAG,IAAI,CAACC,IAAI,EAAE,MAAM,IAAIC,KAAK,CAAC,gCAAgC,CAAC;;EAE3E;EACA,OAAOd,WAAW,CAACS,EAAE,CAACA,EAAE,CAAC,CAACG,GAAG,CAACA,GAAG,CAAC,CAACC,IAAI,CAACA,IAAI,CAAC;AAC/C;;AAEA;AACA,SAASL,mBAAmBA,CAAA,EAAS;EACnC,MAAM;IACJO,eAAe;IACfC,gBAAgB;IAChBC,cAAc;IACdC,cAAc;IACdC,eAAe;IACfC;EACF,CAAC,GAAGlB,OAAO,CAACC,GAAG;EAEf,IAAI,EAAEY,eAAe,IAAIG,cAAc,CAAC,EAAE;IACxC,MAAM,IAAIJ,KAAK,CAAC,uCAAuC,CAAC;EAC1D;EAEAT,QAAQ,GAAG;IACTO,GAAG,EAAEF,WAAE,CAACC,YAAY,CAAEI,eAAe,IAAIG,cAAc,EAAa,OAAO,CAAC;IAC5EL,IAAI,EAAEH,WAAE,CAACC,YAAY,CAAEK,gBAAgB,IAAIG,eAAe,EAAa,OAAO,CAAC;IAC/EV,EAAE,EAAEC,WAAE,CAACC,YAAY,CAAEM,cAAc,IAAIG,MAAM,EAAa,OAAO;EACnE,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backend-test-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Node test tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,43 +21,42 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/prakashmahendran/backend-test-tools#readme",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/cli": "^7.
|
|
25
|
-
"@babel/core": "^7.
|
|
26
|
-
"@babel/plugin-transform-class-properties": "^7.25.
|
|
27
|
-
"@babel/plugin-transform-runtime": "^7.25.
|
|
28
|
-
"@babel/preset-env": "^7.
|
|
29
|
-
"@babel/preset-typescript": "^7.
|
|
30
|
-
"@babel/register": "^7.25.
|
|
31
|
-
"@eslint/js": "^9.
|
|
32
|
-
"@faker-js/faker": "^9.0
|
|
33
|
-
"@types/chai": "^
|
|
34
|
-
"@types/jsonwebtoken": "^
|
|
35
|
-
"@types/mocha": "^
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"@types/node-forge": "^
|
|
38
|
-
"@types/sinon": "^
|
|
39
|
-
"@types/superagent": "^
|
|
40
|
-
"@types/supertest": "^
|
|
24
|
+
"@babel/cli": "^7.26.4",
|
|
25
|
+
"@babel/core": "^7.26.0",
|
|
26
|
+
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
27
|
+
"@babel/plugin-transform-runtime": "^7.25.9",
|
|
28
|
+
"@babel/preset-env": "^7.26.0",
|
|
29
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
30
|
+
"@babel/register": "^7.25.9",
|
|
31
|
+
"@eslint/js": "^9.17.0",
|
|
32
|
+
"@faker-js/faker": "^9.3.0",
|
|
33
|
+
"@types/chai": "^5.0.1",
|
|
34
|
+
"@types/jsonwebtoken": "^9.0.7",
|
|
35
|
+
"@types/mocha": "^10.0.10",
|
|
36
|
+
"@types/node": "^22.10.2",
|
|
37
|
+
"@types/node-forge": "^1.3.11",
|
|
38
|
+
"@types/sinon": "^17.0.3",
|
|
39
|
+
"@types/superagent": "^8.1.9",
|
|
40
|
+
"@types/supertest": "^6.0.2",
|
|
41
41
|
"@types/validator": "^13.12.2",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
43
43
|
"babel-plugin-istanbul": "^7.0.0",
|
|
44
44
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
45
45
|
"babel-plugin-tsconfig-paths": "^1.0.3",
|
|
46
|
-
"core-js": "^3.
|
|
47
|
-
"eslint": "^9.
|
|
48
|
-
"globals": "^15.
|
|
49
|
-
"husky": "^
|
|
50
|
-
"lint-staged": "^
|
|
51
|
-
"mocha": "^
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"prettier": "^3.3.3",
|
|
46
|
+
"core-js": "^3.39.0",
|
|
47
|
+
"eslint": "^9.17.0",
|
|
48
|
+
"globals": "^15.14.0",
|
|
49
|
+
"husky": "^9.1.7",
|
|
50
|
+
"lint-staged": "^15.2.11",
|
|
51
|
+
"mocha": "^11.0.1",
|
|
52
|
+
"nyc": "^17.1.0",
|
|
53
|
+
"prettier": "^3.4.2",
|
|
55
54
|
"rimraf": "^6.0.1",
|
|
56
55
|
"ts-node": "^10.9.2",
|
|
57
56
|
"tsc-alias": "^1.8.10",
|
|
58
57
|
"tsconfig-paths": "^4.2.0",
|
|
59
|
-
"typescript": "^5.
|
|
60
|
-
"typescript-eslint": "^8.
|
|
58
|
+
"typescript": "^5.7.2",
|
|
59
|
+
"typescript-eslint": "^8.18.1"
|
|
61
60
|
},
|
|
62
61
|
"husky": {
|
|
63
62
|
"hooks": {
|
|
@@ -68,16 +67,15 @@
|
|
|
68
67
|
"*.js": "eslint",
|
|
69
68
|
"*.ts": "eslint"
|
|
70
69
|
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"node-server-engine": "^1.1.5"
|
|
72
|
+
},
|
|
71
73
|
"dependencies": {
|
|
72
|
-
"@babel/runtime": "^7.
|
|
73
|
-
"
|
|
74
|
-
"jsonwebtoken": "^8.5.1",
|
|
74
|
+
"@babel/runtime": "^7.26.0",
|
|
75
|
+
"jsonwebtoken": "^9.0.2",
|
|
75
76
|
"node-forge": "^1.3.1",
|
|
76
77
|
"rfdc": "^1.4.1",
|
|
77
|
-
"sinon": "^
|
|
78
|
-
"supertest": "^
|
|
79
|
-
},
|
|
80
|
-
"peerDependencies": {
|
|
81
|
-
"node-server-engine": "^1.0.6"
|
|
78
|
+
"sinon": "^19.0.2",
|
|
79
|
+
"supertest": "^7.0.0"
|
|
82
80
|
}
|
|
83
81
|
}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {generateImageBufferOptions} from './generateImageBuffer.types';
|
|
1
|
+
import sharp from 'sharp';
|
|
3
2
|
|
|
4
|
-
/** Generate a
|
|
5
|
-
export async function
|
|
6
|
-
|
|
3
|
+
/** Generate a random image buffer */
|
|
4
|
+
export async function generateRandomImageBuffer(
|
|
5
|
+
width: number = 150,
|
|
6
|
+
height: number = 150
|
|
7
7
|
): Promise<Buffer> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
8
|
+
// Create a blank image buffer
|
|
9
|
+
const buffer = Buffer.alloc(width * height * 3); // RGB buffer (no alpha channel)
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
// Fill the buffer with random colors
|
|
12
|
+
for (let i = 0; i < buffer.length; i += 3) {
|
|
13
|
+
buffer[i] = Math.floor(Math.random() * 256); // Red
|
|
14
|
+
buffer[i + 1] = Math.floor(Math.random() * 256); // Green
|
|
15
|
+
buffer[i + 2] = Math.floor(Math.random() * 256); // Blue
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Use sharp to create an image from the buffer and convert it to PNG
|
|
19
|
+
const imageBuffer = await sharp(buffer, {
|
|
20
|
+
raw: {
|
|
21
|
+
width: width,
|
|
22
|
+
height: height,
|
|
23
|
+
channels: 3 // RGB
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
.toFormat('png') // Convert to PNG format
|
|
27
|
+
.toBuffer(); // Return the image buffer
|
|
28
|
+
|
|
29
|
+
return imageBuffer;
|
|
30
|
+
}
|
package/src/utils/tlsRequest.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import {agent,
|
|
3
|
-
import {tlsRequestOptions} from './tlsRequest.types';
|
|
2
|
+
import { agent, Agent } from 'supertest'; // Import Agent type
|
|
3
|
+
import { tlsRequestOptions } from './tlsRequest.types';
|
|
4
4
|
|
|
5
5
|
const customAgent = agent(`https://localhost:${process.env.PORT as string}`);
|
|
6
6
|
|
|
@@ -9,12 +9,16 @@ let settings: tlsRequestOptions;
|
|
|
9
9
|
/**
|
|
10
10
|
* Wrapper for supertest that adds TLS encryption
|
|
11
11
|
*/
|
|
12
|
-
export async function tlsRequest(options: tlsRequestOptions = {}): Promise<
|
|
12
|
+
export async function tlsRequest(options: tlsRequestOptions = {}): Promise<Agent> {
|
|
13
13
|
if (!settings) loadDefaultSettings();
|
|
14
|
+
|
|
14
15
|
const ca = options.ca ? fs.readFileSync(options.ca, 'utf-8') : settings.ca;
|
|
15
16
|
const key = options.key ? fs.readFileSync(options.key, 'utf-8') : settings.key;
|
|
16
17
|
const cert = options.cert ? fs.readFileSync(options.cert, 'utf-8') : settings.cert;
|
|
18
|
+
|
|
17
19
|
if (!ca || !key || !cert) throw new Error('Missing some TLS configuration');
|
|
20
|
+
|
|
21
|
+
// Return Agent with configured TLS options
|
|
18
22
|
return customAgent.ca(ca).key(key).cert(cert);
|
|
19
23
|
}
|
|
20
24
|
|