Use a node.js SSL echo server on Linux, keep the Python alternative on Mac. Fixes #1662

This commit is contained in:
Marco Castelluccio 2015-07-07 02:07:00 +02:00
Родитель 34c3f85862
Коммит 6019d6b752
2 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -11,9 +11,11 @@ import platform
(system, node, release, version, machine, processor) = platform.uname()
httpsServer = ['node', 'httpsServer.js']
sslEchoServer = ['node', 'sslEchoServer.js']
if system == "Darwin":
httpsServer = './httpsServer.py'
sslEchoServer = './sslEchoServer.py'
# The test automation scripts to run via casperjs/slimerjs.
automation_scripts = [
@ -52,7 +54,7 @@ server_processes = [
# to the tests/ subdirectory, since they load cert/key files relative to it.
subprocess.Popen(httpsServer, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
bufsize=1, cwd='tests'),
subprocess.Popen('./sslEchoServer.py', stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
subprocess.Popen(sslEchoServer, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
bufsize=1, cwd='tests'),
]

16
tests/sslEchoServer.js Executable file
Просмотреть файл

@ -0,0 +1,16 @@
const fs = require("fs");
const tls = require("tls");
var pem = fs.readFileSync('cert.pem');
var options = {
key: pem,
cert: pem,
secureProtocol: 'SSLv3_method',
};
tls.createServer(options, function(socket) {
socket.on('data', function(data) {
socket.write(data);
});
}).listen(54443);