Skip to content

Commit 5f88543

Browse files
brianoconnellcjihrig
authored andcommitted
test: refactor tls test to use fixtres.readSync
PR-URL: #16816 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent d054e94 commit 5f88543

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/parallel/test-tls-hello-parser-failure.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
'use strict';
2323

2424
const common = require('../common');
25+
const fixtures = require('../common/fixtures');
26+
27+
// This test ensures that the tls parser causes a client error if the client
28+
// sends invalid data.
2529

2630
if (!common.hasCrypto)
2731
common.skip('missing crypto');
@@ -30,11 +34,10 @@ const assert = require('assert');
3034
const tls = require('tls');
3135

3236
const net = require('net');
33-
const fs = require('fs');
3437

3538
const options = {
36-
key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`),
37-
cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`)
39+
key: fixtures.readSync('test_key.pem'),
40+
cert: fixtures.readSync('test_cert.pem')
3841
};
3942

4043
const bonkers = Buffer.alloc(1024 * 1024, 42);

0 commit comments

Comments
 (0)