Disable TLS tests when node doesn't have OpenSSL.
authorRyan Dahl <ry@tinyclouds.org>
Sun, 2 Jan 2011 09:54:19 +0000 (01:54 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Sun, 2 Jan 2011 09:54:19 +0000 (01:54 -0800)
test/simple/test-tls-client-verify.js
test/simple/test-tls-junk-closes-server.js
test/simple/test-tls-securepair-client.js
test/simple/test-tls-securepair-server.js
test/simple/test-tls-server-verify.js

index 78eb186..923153b 100644 (file)
@@ -1,3 +1,9 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+
 var testCases =
   [ { ca: ['ca1-cert'],
       key: 'agent2-key',
index 57f216f..f76a157 100644 (file)
@@ -1,3 +1,8 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
 var common = require('../common');
 var tls = require('tls');
 var fs = require('fs');
index 9bcb7e7..7dbcc92 100644 (file)
@@ -1,3 +1,13 @@
+// There is a bug with 'openssl s_server' which makes it not flush certain
+// important events to stdout when done over a pipe. Therefore we skip this
+// test for all openssl versions less than 1.0.0.
+if (!process.versions.openssl ||
+    parseInt(process.versions.openssl.charCodeAt(0)) < 1) {
+  console.error("Skipping due to old OpenSSL version.");
+  process.exit(0);
+}
+
+
 var common = require('../common');
 var join = require('path').join;
 var net = require('net');
index b172b11..0131b8c 100644 (file)
@@ -1,3 +1,9 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
+
 var common = require('../common');
 var assert = require('assert');
 
index 9d3c094..914c50f 100644 (file)
@@ -1,3 +1,8 @@
+if (!process.versions.openssl) {
+  console.error("Skipping because node compiled without OpenSSL.");
+  process.exit(0);
+}
+
 // 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