From e4b3c00e48634c6e2fec3e734978d112683b9cb2 Mon Sep 17 00:00:00 2001 From: Octavian Ionescu Date: Mon, 6 Nov 2017 17:13:49 +0200 Subject: [PATCH] test: replace fixturesDir with usage of fixtures module Repalce common.fixturesDir with usage of the fixtures module in test-tls-ecdh-disable. Add a comment explaining the test. PR-URL: https://github.com/nodejs/node/pull/16810 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott --- test/parallel/test-tls-ecdh-disable.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index 24ebeb37605115..72b51771c87280 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -19,8 +19,12 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// Test that the usage of eliptic curves are not permitted if disabled during +// server initialization. + 'use strict'; const common = require('../common'); +const { readKey } = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); @@ -30,11 +34,10 @@ if (!common.opensslCli) const assert = require('assert'); const tls = require('tls'); const exec = require('child_process').exec; -const fs = require('fs'); const options = { - key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), - cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`), + key: readKey('agent2-key.pem'), + cert: readKey('agent2-cert.pem'), ciphers: 'ECDHE-RSA-AES128-SHA', ecdhCurve: false };