summaryrefslogtreecommitdiff
path: root/test/parallel/test-tls-server-verify.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-tls-server-verify.js')
-rw-r--r--test/parallel/test-tls-server-verify.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js
index 65ddaa5e2d..86a735f64c 100644
--- a/test/parallel/test-tls-server-verify.js
+++ b/test/parallel/test-tls-server-verify.js
@@ -27,6 +27,11 @@ if (!common.opensslCli) {
return;
}
+if (!common.hasCrypto) {
+ common.skip('missing crypto');
+ return;
+}
+
// This is a rather complex test which sets up various TLS servers with node
// and connects to them using the 'openssl s_client' command line utility
// with various keys. Depending on the certificate authority and other
@@ -35,6 +40,14 @@ if (!common.opensslCli) {
// - accepted and "unauthorized", or
// - accepted and "authorized".
+const assert = require('assert');
+const { spawn } = require('child_process');
+const { SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION } =
+ require('crypto').constants;
+const fs = require('fs');
+const path = require('path');
+const tls = require('tls');
+
const testCases =
[{ title: 'Do not request certs. Everyone is unauthorized.',
requestCert: false,
@@ -119,22 +132,9 @@ const testCases =
}
];
-if (!common.hasCrypto) {
- common.skip('missing crypto');
- return;
-}
-const tls = require('tls');
-
-const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION =
- require('crypto').constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION;
-
-const assert = require('assert');
-const fs = require('fs');
-const spawn = require('child_process').spawn;
-
function filenamePEM(n) {
- return require('path').join(common.fixturesDir, 'keys', `${n}.pem`);
+ return path.join(common.fixturesDir, 'keys', `${n}.pem`);
}