зеркало из https://github.com/mozilla/pluotsorbet.git
Use a node.js SSL echo server on Linux, keep the Python alternative on Mac. Fixes #1662
This commit is contained in:
Родитель
34c3f85862
Коммит
6019d6b752
|
@ -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'),
|
||||
]
|
||||
|
||||
|
|
|
@ -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);
|
Загрузка…
Ссылка в новой задаче