Skip to content

Commit

Permalink
test: remove pass-* certs
Browse files Browse the repository at this point in the history
PR-URL: #27962
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
reasonablytall authored and BridgeAR committed Jun 17, 2019
1 parent 27d6b28 commit 98f7ae9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 67 deletions.
12 changes: 0 additions & 12 deletions test/fixtures/pass-cert.pem

This file was deleted.

10 changes: 0 additions & 10 deletions test/fixtures/pass-csr.pem

This file was deleted.

17 changes: 0 additions & 17 deletions test/fixtures/pass-key.pem

This file was deleted.

15 changes: 0 additions & 15 deletions test/fixtures/raw-key.pem

This file was deleted.

26 changes: 13 additions & 13 deletions test/parallel/test-tls-passphrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const assert = require('assert');
const tls = require('tls');
const fixtures = require('../common/fixtures');

const passKey = fixtures.readSync('pass-key.pem');
const rawKey = fixtures.readSync('raw-key.pem');
const cert = fixtures.readSync('pass-cert.pem');
const passKey = fixtures.readKey('rsa_private_encrypted.pem');
const rawKey = fixtures.readKey('rsa_private.pem');
const cert = fixtures.readKey('rsa_cert.crt');

assert(Buffer.isBuffer(passKey));
assert(Buffer.isBuffer(cert));
Expand All @@ -39,7 +39,7 @@ assert.strictEqual(typeof cert.toString(), 'string');

const server = tls.Server({
key: passKey,
passphrase: 'passphrase',
passphrase: 'password',
cert: cert,
ca: [cert],
requestCert: true,
Expand All @@ -53,7 +53,7 @@ server.listen(0, common.mustCall(function() {
tls.connect({
port: this.address().port,
key: passKey,
passphrase: 'passphrase',
passphrase: 'password',
cert: cert,
rejectUnauthorized: false
}, common.mustCall());
Expand All @@ -77,7 +77,7 @@ server.listen(0, common.mustCall(function() {
tls.connect({
port: this.address().port,
key: [passKey],
passphrase: 'passphrase',
passphrase: 'password',
cert: [cert],
rejectUnauthorized: false
}, common.mustCall());
Expand All @@ -101,7 +101,7 @@ server.listen(0, common.mustCall(function() {
tls.connect({
port: this.address().port,
key: passKey.toString(),
passphrase: 'passphrase',
passphrase: 'password',
cert: cert.toString(),
rejectUnauthorized: false
}, common.mustCall());
Expand All @@ -125,7 +125,7 @@ server.listen(0, common.mustCall(function() {
tls.connect({
port: this.address().port,
key: [passKey.toString()],
passphrase: 'passphrase',
passphrase: 'password',
cert: [cert.toString()],
rejectUnauthorized: false
}, common.mustCall());
Expand All @@ -148,14 +148,14 @@ server.listen(0, common.mustCall(function() {
// Object[]
tls.connect({
port: this.address().port,
key: [{ pem: passKey, passphrase: 'passphrase' }],
key: [{ pem: passKey, passphrase: 'password' }],
cert: cert,
rejectUnauthorized: false
}, common.mustCall());

tls.connect({
port: this.address().port,
key: [{ pem: passKey, passphrase: 'passphrase' }],
key: [{ pem: passKey, passphrase: 'password' }],
passphrase: 'ignored',
cert: cert,
rejectUnauthorized: false
Expand All @@ -164,14 +164,14 @@ server.listen(0, common.mustCall(function() {
tls.connect({
port: this.address().port,
key: [{ pem: passKey }],
passphrase: 'passphrase',
passphrase: 'password',
cert: cert,
rejectUnauthorized: false
}, common.mustCall());

tls.connect({
port: this.address().port,
key: [{ pem: passKey.toString(), passphrase: 'passphrase' }],
key: [{ pem: passKey.toString(), passphrase: 'password' }],
cert: cert,
rejectUnauthorized: false
}, common.mustCall());
Expand Down Expand Up @@ -288,7 +288,7 @@ assert.throws(function() {
tls.connect({
port: server.address().port,
key: [{ pem: passKey, passphrase: 'invalid' }],
passphrase: 'passphrase', // Valid but unused
passphrase: 'password', // Valid but unused
cert: cert,
rejectUnauthorized: false
});
Expand Down

0 comments on commit 98f7ae9

Please sign in to comment.