diff --git a/kitchenradio/node_modules/.bin/nwget b/kitchenradio/node_modules/.bin/nwget new file mode 120000 index 0000000..5ac7c8c --- /dev/null +++ b/kitchenradio/node_modules/.bin/nwget @@ -0,0 +1 @@ +../wget/bin/nwget.js \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/.npmignore b/kitchenradio/node_modules/wget/.npmignore new file mode 100644 index 0000000..91dfed8 --- /dev/null +++ b/kitchenradio/node_modules/wget/.npmignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/LICENSE b/kitchenradio/node_modules/wget/LICENSE new file mode 100644 index 0000000..39dd179 --- /dev/null +++ b/kitchenradio/node_modules/wget/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 Chengwei Wu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/README.md b/kitchenradio/node_modules/wget/README.md new file mode 100644 index 0000000..50c7926 --- /dev/null +++ b/kitchenradio/node_modules/wget/README.md @@ -0,0 +1,4 @@ +node-wget +========= + +wget in nodejs \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/bin/nwget.js b/kitchenradio/node_modules/wget/bin/nwget.js new file mode 100755 index 0000000..e69de29 diff --git a/kitchenradio/node_modules/wget/index.js b/kitchenradio/node_modules/wget/index.js new file mode 100644 index 0000000..8b1191f --- /dev/null +++ b/kitchenradio/node_modules/wget/index.js @@ -0,0 +1,2 @@ +exports.download = require('./lib/wget').download; +exports.request = require('./lib/wget').request; \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/lib/wget.js b/kitchenradio/node_modules/wget/lib/wget.js new file mode 100644 index 0000000..096f73b --- /dev/null +++ b/kitchenradio/node_modules/wget/lib/wget.js @@ -0,0 +1,158 @@ +'use strict' + +var http = require('http'); +var https = require('https'); +var tunnel = require('tunnel'); +var url = require('url'); +var util = require('util'); +var fs = require('fs'); +var EventEmitter = require('events').EventEmitter; + +function download(src, output, options) { + var downloader = new EventEmitter(), + srcUrl, + tunnelAgent, + req; + + if (options) { + options = parseOptions('download', options); + } + srcUrl = url.parse(src); + srcUrl.protocol = cleanProtocol(srcUrl.protocol); + + req = request({ + protocol: srcUrl.protocol, + host: srcUrl.hostname, + port: srcUrl.port, + path: srcUrl.pathname, + proxy: options?options.proxy:undefined, + method: 'GET' + }, function(res) { + var fileSize, writeStream, downloadedSize; + if (res.statusCode === 200) { + downloadedSize = 0; + fileSize = res.headers['content-length']; + writeStream = fs.createWriteStream(output, { + flags: 'a', + encoding: 'binary' + }); + + res.on('error', function(err) { + writeStream.end(); + downloader.emit('error', err); + }); + res.on('data', function(chunk) { + downloadedSize += chunk.length; + downloader.emit('progress', downloadedSize/fileSize); + writeStream.write(chunk); + }); + res.on('end', function() { + writeStream.end(); + downloader.emit('end', output); + }); + } else { + downloader.emit('error', 'Server respond ' + res.statusCode); + } + }); + + req.end(); + req.on('error', function(err) { + downloader.emit('error', err); + }); + + return downloader; +} + +function request(options, callback) { + var newOptions = {}, newProxy = {}, key; + options = parseOptions('request', options); + if (options.protocol === 'http') { + if (options.proxy) { + for (key in options.proxy) { + if (key !== 'protocol') { + newProxy[key] = options.proxy[key]; + } + } + if (options.proxy.protocol === 'http') { + options.agent = tunnel.httpOverHttp({proxy: newProxy}); + } else if (options.proxy.protocol === 'https') { + options.agent = tunnel.httpOverHttps({proxy: newProxy}); + } else { + throw options.proxy.protocol + ' proxy is not supported!'; + } + } + for (key in options) { + if (key !== 'protocol' && key !== 'proxy') { + newOptions[key] = options[key]; + } + } + return http.request(newOptions, callback); + } + if (options.protocol === 'https') { + if (options.proxy) { + for (key in options.proxy) { + if (key !== 'protocol') { + newProxy[key] = options.proxy[key]; + } + } + if (options.proxy.protocol === 'http') { + options.agent = tunnel.httpsOverHttp({proxy: newProxy}); + } else if (options.proxy.protocol === 'https') { + options.agent = tunnel.httpsOverHttps({proxy: newProxy}); + } else { + throw options.proxy.protocol + ' proxy is not supported!'; + } + } + for (key in options) { + if (key !== 'protocol' && key !== 'proxy') { + newOptions[key] = options[key]; + } + } + return https.request(newOptions, callback); + } + throw 'only allow http or https request!'; +} + +function parseOptions(type, options) { + var proxy; + if (type === 'download') { + if (options.proxy) { + if (typeof options.proxy === 'string') { + proxy = url.parse(options.proxy); + options.proxy = {}; + options.proxy.protocol = cleanProtocol(proxy.protocol); + options.proxy.host = proxy.hostname; + options.proxy.port = proxy.port; + options.proxy.proxyAuth = proxy.auth; + options.proxy.headers = {'User-Agent': 'Node'}; + } + } + return options; + } + if (type === 'request') { + if (!options.protocol) { + options.protocol = 'http'; + } + options.protocol = cleanProtocol(options.protocol); + + if (options.proxy) { + if (typeof options.proxy === 'string') { + proxy = url.parse(options.proxy); + options.proxy = {}; + options.proxy.protocol = cleanProtocol(proxy.protocol); + options.proxy.host = proxy.hostname; + options.proxy.port = proxy.port; + options.proxy.proxyAuth = proxy.auth; + options.proxy.headers = {'User-Agent': 'Node'}; + } + } + return options; + } +} + +function cleanProtocol(str) { + return str.trim().toLowerCase().replace(/:$/, ''); +} + +exports.download = download; +exports.request = request; \ No newline at end of file diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/.npmignore b/kitchenradio/node_modules/wget/node_modules/tunnel/.npmignore new file mode 100644 index 0000000..6684c76 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/.npmignore @@ -0,0 +1,2 @@ +/.idea +/node_modules diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/CHANGELOG.md b/kitchenradio/node_modules/wget/node_modules/tunnel/CHANGELOG.md new file mode 100644 index 0000000..eb1ad91 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + + - 0.0.1 (2012/02/18) + - supported Node v0.6.x (0.6.11 or later). + + - 0.0.0 (2012/02/11) + - first release. diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/README.md b/kitchenradio/node_modules/wget/node_modules/tunnel/README.md new file mode 100644 index 0000000..edf04f9 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/README.md @@ -0,0 +1,172 @@ +# node-tunnel - HTTP/HTTPS Agents for tunneling proxies + +## Example + +```javascript +var tunnel = require('tunnel'); + +var tunnelingAgent = tunnel.httpsOverHttp({ + proxy: { + host: 'localhost', + port: 3128 + } +}); + +var req = https.request({ + host: 'example.com', + port: 443, + agent: tunnelingAgent +}); +``` + +## Installation + + $ npm install tunnel + +## Usages + +### HTTP over HTTP tunneling + +```javascript +var tunnelingAgent = tunnel.httpOverHttp({ + maxSockets: poolSize, // Defaults to 5 + + proxy: { // Proxy settings + host: proxyHost, // Defaults to 'localhost' + port: proxyPort, // Defaults to 80 + localAddress: localAddress, // Local interface if necessary + + // Basic authorization for proxy server if necessary + proxyAuth: 'user:password', + + // Header fields for proxy server if necessary + headers: { + 'User-Agent': 'Node' + } + } +}); + +var req = http.request({ + host: 'example.com', + port: 80, + agent: tunnelingAgent +}); +``` + +### HTTPS over HTTP tunneling + +```javascript +var tunnelingAgent = tunnel.httpsOverHttp({ + maxSockets: poolSize, // Defaults to 5 + + // CA for origin server if necessary + ca: [ fs.readFileSync('origin-server-ca.pem')], + + // Client certification for origin server if necessary + key: fs.readFileSync('origin-server-key.pem'), + cert: fs.readFileSync('origin-server-cert.pem'), + + proxy: { // Proxy settings + host: proxyHost, // Defaults to 'localhost' + port: proxyPort, // Defaults to 80 + localAddress: localAddress, // Local interface if necessary + + // Basic authorization for proxy server if necessary + proxyAuth: 'user:password', + + // Header fields for proxy server if necessary + headers: { + 'User-Agent': 'Node' + }, + } +}); + +var req = https.request({ + host: 'example.com', + port: 443, + agent: tunnelingAgent +}); +``` + +### HTTP over HTTPS tunneling + +```javascript +var tunnelingAgent = tunnel.httpOverHttps({ + maxSockets: poolSize, // Defaults to 5 + + proxy: { // Proxy settings + host: proxyHost, // Defaults to 'localhost' + port: proxyPort, // Defaults to 443 + localAddress: localAddress, // Local interface if necessary + + // Basic authorization for proxy server if necessary + proxyAuth: 'user:password', + + // Header fields for proxy server if necessary + headers: { + 'User-Agent': 'Node' + }, + + // CA for proxy server if necessary + ca: [ fs.readFileSync('origin-server-ca.pem')], + + // Server name for verification if necessary + servername: 'example.com', + + // Client certification for proxy server if necessary + key: fs.readFileSync('origin-server-key.pem'), + cert: fs.readFileSync('origin-server-cert.pem'), + } +}); + +var req = http.request({ + host: 'example.com', + port: 80, + agent: tunnelingAgent +}); +``` + +### HTTPS over HTTPS tunneling + +```javascript +var tunnelingAgent = tunnel.httpsOverHttps({ + maxSockets: poolSize, // Defaults to 5 + + // CA for origin server if necessary + ca: [ fs.readFileSync('origin-server-ca.pem')], + + // Client certification for origin server if necessary + key: fs.readFileSync('origin-server-key.pem'), + cert: fs.readFileSync('origin-server-cert.pem'), + + proxy: { // Proxy settings + host: proxyHost, // Defaults to 'localhost' + port: proxyPort, // Defaults to 443 + localAddress: localAddress, // Local interface if necessary + + // Basic authorization for proxy server if necessary + proxyAuth: 'user:password', + + // Header fields for proxy server if necessary + headers: { + 'User-Agent': 'Node' + } + + // CA for proxy server if necessary + ca: [ fs.readFileSync('origin-server-ca.pem')], + + // Server name for verification if necessary + servername: 'example.com', + + // Client certification for proxy server if necessary + key: fs.readFileSync('origin-server-key.pem'), + cert: fs.readFileSync('origin-server-cert.pem'), + } +}); + +var req = https.request({ + host: 'example.com', + port: 443, + agent: tunnelingAgent +}); +``` diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/index.js b/kitchenradio/node_modules/wget/node_modules/tunnel/index.js new file mode 100644 index 0000000..2947757 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/tunnel'); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/lib/tunnel.js b/kitchenradio/node_modules/wget/node_modules/tunnel/lib/tunnel.js new file mode 100644 index 0000000..9cb5073 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/lib/tunnel.js @@ -0,0 +1,234 @@ +'use strict'; + +var net = require('net'); +var tls = require('tls'); +var http = require('http'); +var https = require('https'); +var events = require('events'); +var assert = require('assert'); +var util = require('util'); + + +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + return agent; +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + return agent; +} + + +function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + + self.on('free', function onFree(socket, host, port) { + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === host && pending.port === port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); +} +util.inherits(TunnelingAgent, events.EventEmitter); + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { + var self = this; + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push({host: host, port: port, request: req}); + return; + } + + // If we are under maxSockets create a new one. + self.createSocket({host: host, port: port, request: req}, function(socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); + + function onFree() { + self.emit('free', socket, host, port); + } + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); + } + }); +}; + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false + }); + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64'); + } + + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once('response', onResponse); // for v0.6 + connectReq.once('upgrade', onUpgrade); // for v0.6 + connectReq.once('connect', onConnect); // for v0.7 or later + connectReq.once('error', onError); + connectReq.end(); + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + + if (res.statusCode === 200) { + assert.equal(head.length, 0); + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + cb(socket); + } else { + debug('tunneling socket could not be established, statusCode=%d', + res.statusCode); + var error = new Error('tunneling socket could not be established, ' + + 'sutatusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } + } + + function onError(cause) { + connectReq.removeAllListeners(); + + debug('tunneling socket could not be established, cause=%s\n', + cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, ' + + 'cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } +}; + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + } +}; + +function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host + }); + + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} + + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; + } + } + } + } + return target; +} + + +var debug; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; + } else { + args.unshift('TUNNEL:'); + } + console.error.apply(console, args); + } +} else { + debug = function() {}; +} +exports.debug = debug; // for test diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/package.json b/kitchenradio/node_modules/wget/node_modules/tunnel/package.json new file mode 100644 index 0000000..fc1a077 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/package.json @@ -0,0 +1,44 @@ +{ + "name": "tunnel", + "version": "0.0.2", + "description": "Node HTTP/HTTPS Agents for tunneling proxies", + "keywords": [ + "http", + "https", + "agent", + "proxy" + ], + "homepage": "https://github.com/koichik/node-tunnel/", + "author": { + "name": "Koichi Kobayashi", + "email": "koichik@improvement.jp" + }, + "main": "./index.js", + "licenses": { + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + }, + "repositories": "https://github.com/koichik/node-tunnel.git", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + }, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "scripts": { + "test": "./node_modules/mocha/bin/mocha" + }, + "readme": "# node-tunnel - HTTP/HTTPS Agents for tunneling proxies\n\n## Example\n\n```javascript\nvar tunnel = require('tunnel');\n\nvar tunnelingAgent = tunnel.httpsOverHttp({\n proxy: {\n host: 'localhost',\n port: 3128\n }\n});\n\nvar req = https.request({\n host: 'example.com',\n port: 443,\n agent: tunnelingAgent\n});\n```\n\n## Installation\n\n $ npm install tunnel\n\n## Usages\n\n### HTTP over HTTP tunneling\n\n```javascript\nvar tunnelingAgent = tunnel.httpOverHttp({\n maxSockets: poolSize, // Defaults to 5\n\n proxy: { // Proxy settings\n host: proxyHost, // Defaults to 'localhost'\n port: proxyPort, // Defaults to 80\n localAddress: localAddress, // Local interface if necessary\n\n // Basic authorization for proxy server if necessary\n proxyAuth: 'user:password',\n\n // Header fields for proxy server if necessary\n headers: {\n 'User-Agent': 'Node'\n }\n }\n});\n\nvar req = http.request({\n host: 'example.com',\n port: 80,\n agent: tunnelingAgent\n});\n```\n\n### HTTPS over HTTP tunneling\n\n```javascript\nvar tunnelingAgent = tunnel.httpsOverHttp({\n maxSockets: poolSize, // Defaults to 5\n\n // CA for origin server if necessary\n ca: [ fs.readFileSync('origin-server-ca.pem')],\n\n // Client certification for origin server if necessary\n key: fs.readFileSync('origin-server-key.pem'),\n cert: fs.readFileSync('origin-server-cert.pem'),\n\n proxy: { // Proxy settings\n host: proxyHost, // Defaults to 'localhost'\n port: proxyPort, // Defaults to 80\n localAddress: localAddress, // Local interface if necessary\n\n // Basic authorization for proxy server if necessary\n proxyAuth: 'user:password',\n\n // Header fields for proxy server if necessary\n headers: {\n 'User-Agent': 'Node'\n },\n }\n});\n\nvar req = https.request({\n host: 'example.com',\n port: 443,\n agent: tunnelingAgent\n});\n```\n\n### HTTP over HTTPS tunneling\n\n```javascript\nvar tunnelingAgent = tunnel.httpOverHttps({\n maxSockets: poolSize, // Defaults to 5\n\n proxy: { // Proxy settings\n host: proxyHost, // Defaults to 'localhost'\n port: proxyPort, // Defaults to 443\n localAddress: localAddress, // Local interface if necessary\n\n // Basic authorization for proxy server if necessary\n proxyAuth: 'user:password',\n\n // Header fields for proxy server if necessary\n headers: {\n 'User-Agent': 'Node'\n },\n\n // CA for proxy server if necessary\n ca: [ fs.readFileSync('origin-server-ca.pem')],\n\n // Server name for verification if necessary\n servername: 'example.com',\n\n // Client certification for proxy server if necessary\n key: fs.readFileSync('origin-server-key.pem'),\n cert: fs.readFileSync('origin-server-cert.pem'),\n }\n});\n\nvar req = http.request({\n host: 'example.com',\n port: 80,\n agent: tunnelingAgent\n});\n```\n\n### HTTPS over HTTPS tunneling\n\n```javascript\nvar tunnelingAgent = tunnel.httpsOverHttps({\n maxSockets: poolSize, // Defaults to 5\n\n // CA for origin server if necessary\n ca: [ fs.readFileSync('origin-server-ca.pem')],\n\n // Client certification for origin server if necessary\n key: fs.readFileSync('origin-server-key.pem'),\n cert: fs.readFileSync('origin-server-cert.pem'),\n\n proxy: { // Proxy settings\n host: proxyHost, // Defaults to 'localhost'\n port: proxyPort, // Defaults to 443\n localAddress: localAddress, // Local interface if necessary\n\n // Basic authorization for proxy server if necessary\n proxyAuth: 'user:password',\n\n // Header fields for proxy server if necessary\n headers: {\n 'User-Agent': 'Node'\n }\n\n // CA for proxy server if necessary\n ca: [ fs.readFileSync('origin-server-ca.pem')],\n\n // Server name for verification if necessary\n servername: 'example.com',\n\n // Client certification for proxy server if necessary\n key: fs.readFileSync('origin-server-key.pem'),\n cert: fs.readFileSync('origin-server-cert.pem'),\n }\n});\n\nvar req = https.request({\n host: 'example.com',\n port: 443,\n agent: tunnelingAgent\n});\n```\n", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "h" + }, + "_id": "tunnel@0.0.2", + "dist": { + "shasum": "0a12b2e66e56193b55dfa27d62c601348c87d9dd" + }, + "_from": "tunnel@0.0.2", + "_resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.2.tgz" +} diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-http.js b/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-http.js new file mode 100644 index 0000000..73d17a2 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-http.js @@ -0,0 +1,108 @@ +var http = require('http'); +var net = require('net'); +var should = require('should'); +var tunnel = require('../index'); + +describe('HTTP over HTTP', function() { + it('should finish without error', function(done) { + var serverPort = 3000; + var proxyPort = 3001; + var poolSize = 3; + var N = 10; + var serverConnect = 0; + var proxyConnect = 0; + var clientConnect = 0; + var server; + var proxy; + var agent; + + server = http.createServer(function(req, res) { + tunnel.debug('SERVER: got request'); + ++serverConnect; + res.writeHead(200); + res.end('Hello' + req.url); + tunnel.debug('SERVER: sending response'); + }); + server.listen(serverPort, setupProxy); + + function setupProxy() { + proxy = http.createServer(function(req, res) { + should.fail(); + }); + proxy.on('upgrade', onConnect); // for v0.6 + proxy.on('connect', onConnect); // for v0.7 or later + + function onConnect(req, clientSocket, head) { + tunnel.debug('PROXY: got CONNECT request'); + + req.method.should.equal('CONNECT'); + req.url.should.equal('localhost:' + serverPort); + req.headers.should.not.have.property('transfer-encoding'); + req.headers.should.have.property('proxy-authorization', + 'Basic ' + new Buffer('user:password').toString('base64')); + ++proxyConnect; + + tunnel.debug('PROXY: creating a tunnel'); + var serverSocket = net.connect(serverPort, function() { + tunnel.debug('PROXY: replying to client CONNECT request'); + clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n'); + clientSocket.pipe(serverSocket); + serverSocket.write(head); + serverSocket.pipe(clientSocket); + // workaround, see joyent/node#2524 + serverSocket.on('end', function() { + clientSocket.end(); + }); + }); + } + proxy.listen(proxyPort, setupClient); + } + + function setupClient() { + agent = tunnel.httpOverHttp({ + maxSockets: poolSize, + proxy: { + port: proxyPort, + proxyAuth: 'user:password' + } + }); + + for (var i = 0; i < N; ++i) { + doClientRequest(i); + } + + function doClientRequest(i) { + tunnel.debug('CLIENT: Making HTTP request (%d)', i); + var req = http.get({ + port: serverPort, + path: '/' + i, + agent: agent + }, function(res) { + tunnel.debug('CLIENT: got HTTP response (%d)', i); + res.setEncoding('utf8'); + res.on('data', function(data) { + data.should.equal('Hello/' + i); + }); + res.on('end', function() { + ++clientConnect; + if (clientConnect === N) { + proxy.close(); + server.close(); + } + }); + }); + } + } + + server.on('close', function() { + serverConnect.should.equal(N); + proxyConnect.should.equal(poolSize); + clientConnect.should.equal(N); + + agent.sockets.should.be.empty; + agent.requests.should.be.empty; + + done(); + }); + }); +}); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-https.js b/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-https.js new file mode 100644 index 0000000..0d12b17 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/http-over-https.js @@ -0,0 +1,122 @@ +var http = require('http'); +var https = require('https'); +var net = require('net'); +var fs = require('fs'); +var path = require('path'); +var should = require('should'); +var tunnel = require('../index'); + +function readPem(file) { + return fs.readFileSync(path.join('test/keys', file + '.pem')); +} + +describe('HTTP over HTTPS', function() { + it('should finish without error', function(done) { + var serverPort = 3004; + var proxyPort = 3005; + var poolSize = 3; + var N = 10; + var serverConnect = 0; + var proxyConnect = 0; + var clientConnect = 0; + var server; + var proxy; + var agent; + + server = http.createServer(function(req, res) { + tunnel.debug('SERVER: got request'); + ++serverConnect; + res.writeHead(200); + res.end('Hello' + req.url); + tunnel.debug('SERVER: sending response'); + }); + server.listen(serverPort, setupProxy); + + function setupProxy() { + proxy = https.createServer({ + key: readPem('agent4-key'), + cert: readPem('agent4-cert'), + ca: [readPem('ca2-cert')], // ca for agent3 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + should.fail(); + }); + proxy.on('upgrade', onConnect); // for v0.6 + proxy.on('connect', onConnect); // for v0.7 or later + + function onConnect(req, clientSocket, head) { + tunnel.debug('PROXY: got CONNECT request'); + + req.method.should.equal('CONNECT'); + req.url.should.equal('localhost:' + serverPort); + req.headers.should.not.have.property('transfer-encoding'); + ++proxyConnect; + + tunnel.debug('PROXY: creating a tunnel'); + var serverSocket = net.connect(serverPort, function() { + tunnel.debug('PROXY: replying to client CONNECT request'); + clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n'); + clientSocket.pipe(serverSocket); + serverSocket.write(head); + serverSocket.pipe(clientSocket); + // workaround, see joyent/node#2524 + serverSocket.on('end', function() { + clientSocket.end(); + }); + }); + } + proxy.listen(proxyPort, setupClient); + } + + function setupClient() { + agent = tunnel.httpOverHttps({ + maxSockets: poolSize, + proxy: { + port: proxyPort, + // client certification for proxy + key: readPem('agent3-key'), + cert: readPem('agent3-cert') + } + }); + + for (var i = 0; i < N; ++i) { + doClientRequest(i); + } + + function doClientRequest(i) { + tunnel.debug('CLIENT: Making HTTP request (%d)', i); + var req = http.get({ + port: serverPort, + path: '/' + i, + agent: agent + }, function(res) { + tunnel.debug('CLIENT: got HTTP response (%d)', i); + res.setEncoding('utf8'); + res.on('data', function(data) { + data.should.equal('Hello/' + i); + }); + res.on('end', function() { + ++clientConnect; + if (clientConnect === N) { + proxy.close(); + server.close(); + } + }); + }); + } + } + + server.on('close', function() { + serverConnect.should.equal(N); + proxyConnect.should.equal(poolSize); + clientConnect.should.equal(N); + + var name = 'localhost:' + serverPort; + agent.sockets.should.be.empty; + agent.requests.should.be.empty; + + done(); + }); + }); +}); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-http.js b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-http.js new file mode 100644 index 0000000..1d40c69 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-http.js @@ -0,0 +1,121 @@ +var http = require('http'); +var https = require('https'); +var net = require('net'); +var fs = require('fs'); +var path = require('path'); +var should = require('should'); +var tunnel = require('../index'); + +function readPem(file) { + return fs.readFileSync(path.join('test/keys', file + '.pem')); +} + +describe('HTTPS over HTTP', function() { + it('should finish without error', function(done) { + var serverPort = 3002; + var proxyPort = 3003; + var poolSize = 3; + var N = 10; + var serverConnect = 0; + var proxyConnect = 0; + var clientConnect = 0; + var server; + var proxy; + var agent; + + server = https.createServer({ + key: readPem('agent2-key'), + cert: readPem('agent2-cert'), + ca: [readPem('ca1-cert')], // ca for agent1 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + tunnel.debug('SERVER: got request'); + ++serverConnect; + res.writeHead(200); + res.end('Hello' + req.url); + tunnel.debug('SERVER: sending response'); + }); + server.listen(serverPort, setupProxy); + + function setupProxy() { + proxy = http.createServer(function(req, res) { + should.fail(); + }); + proxy.on('upgrade', onConnect); // for v0.6 + proxy.on('connect', onConnect); // for v0.7 or later + + function onConnect(req, clientSocket, head) { + tunnel.debug('PROXY: got CONNECT request'); + + req.method.should.equal('CONNECT'); + req.url.should.equal('localhost:' + serverPort); + req.headers.should.not.have.property('transfer-encoding'); + ++proxyConnect; + + var serverSocket = net.connect(serverPort, function() { + tunnel.debug('PROXY: replying to client CONNECT request'); + clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n'); + clientSocket.pipe(serverSocket); + serverSocket.write(head); + serverSocket.pipe(clientSocket); + // workaround, see joyent/node#2524 + serverSocket.on('end', function() { + clientSocket.end(); + }); + }); + } + proxy.listen(proxyPort, setupClient); + } + + function setupClient() { + agent = tunnel.httpsOverHttp({ + maxSockets: poolSize, + // client certification for origin server + key: readPem('agent1-key'), + cert: readPem('agent1-cert'), + proxy: { + port: proxyPort + } + }); + + for (var i = 0; i < N; ++i) { + doClientRequest(i); + } + + function doClientRequest(i) { + tunnel.debug('CLIENT: Making HTTPS request (%d)', i); + var req = https.get({ + port: serverPort, + path: '/' + i, + agent: agent + }, function(res) { + tunnel.debug('CLIENT: got HTTPS response (%d)', i); + res.setEncoding('utf8'); + res.on('data', function(data) { + data.should.equal('Hello/' + i); + }); + res.on('end', function() { + ++clientConnect; + if (clientConnect === N) { + proxy.close(); + server.close(); + } + }); + }); + } + } + + server.on('close', function() { + serverConnect.should.equal(N); + proxyConnect.should.equal(poolSize); + clientConnect.should.equal(N); + + var name = 'localhost:' + serverPort; + agent.sockets.should.be.empty; + agent.requests.should.be.empty; + + done(); + }); + }); +}); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https-error.js b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https-error.js new file mode 100644 index 0000000..33f4810 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https-error.js @@ -0,0 +1,212 @@ +var http = require('http'); +var https = require('https'); +var net = require('net'); +var fs = require('fs'); +var path = require('path'); +var should = require('should'); +var tunnel = require('../index'); + +function readPem(file) { + return fs.readFileSync(path.join('test/keys', file + '.pem')); +} + +describe('HTTPS over HTTPS authentication failed', function() { + it('should finish without error', function(done) { + var serverPort = 3008; + var proxyPort = 3009; + var serverConnect = 0; + var proxyConnect = 0; + var clientRequest = 0; + var clientConnect = 0; + var clientError = 0; + var server; + var proxy; + + server = https.createServer({ + key: readPem('agent1-key'), // agent1 is signed by ca1 + cert: readPem('agent1-cert'), + ca: [ readPem('ca2-cert') ], // ca for agent3 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + tunnel.debug('SERVER: got request'); + ++serverConnect; + res.writeHead(200); + res.end('Hello, ' + serverConnect); + tunnel.debug('SERVER: sending response'); + }); + server.listen(serverPort, setupProxy); + + function setupProxy() { + proxy = https.createServer({ + key: readPem('agent3-key'), // agent3 is signed by ca2 + cert: readPem('agent3-cert'), + ca: [ readPem('ca1-cert') ], // ca for agent1 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + should.fail(); + }); + proxy.on('upgrade', onConnect); // for v0.6 + proxy.on('connect', onConnect); // for v0.7 or later + + function onConnect(req, clientSocket, head) { + req.method.should.equal('CONNECT'); + req.url.should.equal('localhost:' + serverPort); + req.headers.should.not.have.property('transfer-encoding'); + ++proxyConnect; + + var serverSocket = net.connect(serverPort, function() { + tunnel.debug('PROXY: replying to client CONNECT request'); + clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n'); + clientSocket.pipe(serverSocket); + serverSocket.write(head); + serverSocket.pipe(clientSocket); + // workaround, see #2524 + serverSocket.on('end', function() { + clientSocket.end(); + }); + }); + } + proxy.listen(proxyPort, setupClient); + } + + function setupClient() { + function doRequest(name, options, host) { + tunnel.debug('CLIENT: Making HTTPS request (%s)', name); + ++clientRequest; + var agent = tunnel.httpsOverHttps(options); + var req = https.get({ + port: serverPort, + headers: { + host: host ? host : 'localhost', + }, + agent: agent + }, function(res) { + tunnel.debug('CLIENT: got HTTPS response (%s)', name); + ++clientConnect; + req.emit('finish'); + }); + req.on('error', function(err) { + tunnel.debug('CLIENT: failed HTTP response (%s)', name, err); + ++clientError; + req.emit('finish'); + }); + req.on('finish', function() { + if (clientConnect + clientError === clientRequest) { + proxy.close(); + server.close(); + } + }); + } + + doRequest('no cert origin nor proxy', { // invalid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for origin server (agent1) + rejectUnauthorized: true, + // no certificate for origin server + proxy: { + port: proxyPort, + servername: 'agent3', + ca: [ readPem('ca2-cert') ], // ca for proxy server (agent3) + rejectUnauthorized: true + // no certificate for proxy + } + }, 'agent1'); + + doRequest('no cert proxy', { // invalid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for origin server (agent1) + rejectUnauthorized: true, + // client certification for origin server + key: readPem('agent3-key'), + cert: readPem('agent3-cert'), + proxy: { + port: proxyPort, + servername: 'agent3', + ca: [ readPem('ca2-cert') ], // ca for proxy server (agent3) + rejectUnauthorized: true + // no certificate for proxy + } + }, 'agent1'); + + doRequest('no cert origin', { // invalid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for origin server (agent1) + rejectUnauthorized: true, + // no certificate for origin server + proxy: { + port: proxyPort, + servername: 'agent3', + ca: [ readPem('ca2-cert') ], // ca for proxy server (agent3) + rejectUnauthorized: true, + // client certification for proxy + key: readPem('agent1-key'), + cert: readPem('agent1-cert') + } + }, 'agent1'); + + doRequest('invalid proxy server name', { // invalid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for origin server (agent1) + rejectUnauthorized: true, + // client certification for origin server + key: readPem('agent3-key'), + cert: readPem('agent3-cert'), + proxy: { + port: proxyPort, + ca: [ readPem('ca2-cert') ], // ca for agent3 + rejectUnauthorized: true, + // client certification for proxy + key: readPem('agent1-key'), + cert: readPem('agent1-cert') + } + }, 'agent1'); + + doRequest('invalid origin server name', { // invalid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for agent1 + rejectUnauthorized: true, + // client certification for origin server + key: readPem('agent3-key'), + cert: readPem('agent3-cert'), + proxy: { + port: proxyPort, + servername: 'agent3', + ca: [ readPem('ca2-cert') ], // ca for proxy server (agent3) + rejectUnauthorized: true, + // client certification for proxy + key: readPem('agent1-key'), + cert: readPem('agent1-cert') + } + }); + + doRequest('valid', { // valid + maxSockets: 1, + ca: [ readPem('ca1-cert') ], // ca for origin server (agent1) + rejectUnauthorized: true, + // client certification for origin server + key: readPem('agent3-key'), + cert: readPem('agent3-cert'), + proxy: { + port: proxyPort, + servername: 'agent3', + ca: [ readPem('ca2-cert') ], // ca for proxy server (agent3) + rejectUnauthorized: true, + // client certification for proxy + key: readPem('agent1-key'), + cert: readPem('agent1-cert') + } + }, 'agent1'); + } + + server.on('close', function() { + serverConnect.should.equal(1); + proxyConnect.should.equal(3); + clientConnect.should.equal(1); + clientError.should.equal(5); + + done(); + }); + }); +}); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https.js b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https.js new file mode 100644 index 0000000..025b9c6 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/https-over-https.js @@ -0,0 +1,129 @@ +var http = require('http'); +var https = require('https'); +var net = require('net'); +var fs = require('fs'); +var path = require('path'); +var should = require('should'); +var tunnel = require('../index.js'); + +function readPem(file) { + return fs.readFileSync(path.join('test/keys', file + '.pem')); +} + +describe('HTTPS over HTTPS', function() { + it('should finish without error', function(done) { + var serverPort = 3006; + var proxyPort = 3007; + var poolSize = 3; + var N = 5; + var serverConnect = 0; + var proxyConnect = 0; + var clientConnect = 0; + var server; + var proxy; + var agent; + + server = https.createServer({ + key: readPem('agent2-key'), + cert: readPem('agent2-cert'), + ca: [readPem('ca1-cert')], // ca for agent1 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + tunnel.debug('SERVER: got request'); + ++serverConnect; + res.writeHead(200); + res.end('Hello' + req.url); + tunnel.debug('SERVER: sending response'); + }); + server.listen(serverPort, setupProxy); + + function setupProxy() { + proxy = https.createServer({ + key: readPem('agent4-key'), + cert: readPem('agent4-cert'), + ca: [readPem('ca2-cert')], // ca for agent3 + requestCert: true, + rejectUnauthorized: true + }, function(req, res) { + should.fail(); + }); + proxy.on('upgrade', onConnect); // for v0.6 + proxy.on('connect', onConnect); // for v0.7 or later + + function onConnect(req, clientSocket, head) { + tunnel.debug('PROXY: got CONNECT request'); + req.method.should.equal('CONNECT'); + req.url.should.equal('localhost:' + serverPort); + req.headers.should.not.have.property('transfer-encoding'); + ++proxyConnect; + + var serverSocket = net.connect(serverPort, function() { + tunnel.debug('PROXY: replying to client CONNECT request'); + clientSocket.write('HTTP/1.1 200 Connection established\r\n\r\n'); + clientSocket.pipe(serverSocket); + serverSocket.write(head); + serverSocket.pipe(clientSocket); + // workaround, see joyent/node#2524 + serverSocket.on('end', function() { + clientSocket.end(); + }); + }); + } + proxy.listen(proxyPort, setupClient); + } + + function setupClient() { + agent = tunnel.httpsOverHttps({ + maxSockets: poolSize, + // client certification for origin server + key: readPem('agent1-key'), + cert: readPem('agent1-cert'), + proxy: { + port: proxyPort, + // client certification for proxy + key: readPem('agent3-key'), + cert: readPem('agent3-cert') + } + }); + + for (var i = 0; i < N; ++i) { + doClientRequest(i); + } + + function doClientRequest(i) { + tunnel.debug('CLIENT: Making HTTPS request (%d)', i); + var req = https.get({ + port: serverPort, + path: '/' + i, + agent: agent + }, function(res) { + tunnel.debug('CLIENT: got HTTPS response (%d)', i); + res.setEncoding('utf8'); + res.on('data', function(data) { + data.should.equal('Hello/' + i); + }); + res.on('end', function() { + ++clientConnect; + if (clientConnect === N) { + proxy.close(); + server.close(); + } + }); + }); + } + } + + server.on('close', function() { + serverConnect.should.equal(N); + proxyConnect.should.equal(poolSize); + clientConnect.should.equal(N); + + var name = 'localhost:' + serverPort; + agent.sockets.should.be.empty; + agent.requests.should.be.empty; + + done(); + }); + }); +}); diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/Makefile b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/Makefile new file mode 100644 index 0000000..fa64352 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/Makefile @@ -0,0 +1,137 @@ +all: agent1-cert.pem agent2-cert.pem agent3-cert.pem agent4-cert.pem ca2-crl.pem + + +# +# Create Certificate Authority: ca1 +# ('password' is used for the CA password.) +# +ca1-cert.pem: ca1.cnf + openssl req -new -x509 -days 9999 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem + +# +# Create Certificate Authority: ca2 +# ('password' is used for the CA password.) +# +ca2-cert.pem: ca2.cnf + openssl req -new -x509 -days 9999 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem + echo '01' > ca2-serial + touch ca2-database.txt + + +# +# agent1 is signed by ca1. +# + +agent1-key.pem: + openssl genrsa -out agent1-key.pem + +agent1-csr.pem: agent1.cnf agent1-key.pem + openssl req -new -config agent1.cnf -key agent1-key.pem -out agent1-csr.pem + +agent1-cert.pem: agent1-csr.pem ca1-cert.pem ca1-key.pem + openssl x509 -req \ + -days 9999 \ + -passin "pass:password" \ + -in agent1-csr.pem \ + -CA ca1-cert.pem \ + -CAkey ca1-key.pem \ + -CAcreateserial \ + -out agent1-cert.pem + +agent1-verify: agent1-cert.pem ca1-cert.pem + openssl verify -CAfile ca1-cert.pem agent1-cert.pem + + +# +# agent2 has a self signed cert +# +# Generate new private key +agent2-key.pem: + openssl genrsa -out agent2-key.pem + +# Create a Certificate Signing Request for the key +agent2-csr.pem: agent2-key.pem agent2.cnf + openssl req -new -config agent2.cnf -key agent2-key.pem -out agent2-csr.pem + +# Create a Certificate for the agent. +agent2-cert.pem: agent2-csr.pem agent2-key.pem + openssl x509 -req \ + -days 9999 \ + -in agent2-csr.pem \ + -signkey agent2-key.pem \ + -out agent2-cert.pem + +agent2-verify: agent2-cert.pem + openssl verify -CAfile agent2-cert.pem agent2-cert.pem + +# +# agent3 is signed by ca2. +# + +agent3-key.pem: + openssl genrsa -out agent3-key.pem + +agent3-csr.pem: agent3.cnf agent3-key.pem + openssl req -new -config agent3.cnf -key agent3-key.pem -out agent3-csr.pem + +agent3-cert.pem: agent3-csr.pem ca2-cert.pem ca2-key.pem + openssl x509 -req \ + -days 9999 \ + -passin "pass:password" \ + -in agent3-csr.pem \ + -CA ca2-cert.pem \ + -CAkey ca2-key.pem \ + -CAcreateserial \ + -out agent3-cert.pem + +agent3-verify: agent3-cert.pem ca2-cert.pem + openssl verify -CAfile ca2-cert.pem agent3-cert.pem + + +# +# agent4 is signed by ca2 (client cert) +# + +agent4-key.pem: + openssl genrsa -out agent4-key.pem + +agent4-csr.pem: agent4.cnf agent4-key.pem + openssl req -new -config agent4.cnf -key agent4-key.pem -out agent4-csr.pem + +agent4-cert.pem: agent4-csr.pem ca2-cert.pem ca2-key.pem + openssl x509 -req \ + -days 9999 \ + -passin "pass:password" \ + -in agent4-csr.pem \ + -CA ca2-cert.pem \ + -CAkey ca2-key.pem \ + -CAcreateserial \ + -extfile agent4.cnf \ + -extensions ext_key_usage \ + -out agent4-cert.pem + +agent4-verify: agent4-cert.pem ca2-cert.pem + openssl verify -CAfile ca2-cert.pem agent4-cert.pem + +# +# Make CRL with agent4 being rejected +# +ca2-crl.pem: ca2-key.pem ca2-cert.pem ca2.cnf + openssl ca -revoke agent4-cert.pem \ + -keyfile ca2-key.pem \ + -cert ca2-cert.pem \ + -config ca2.cnf + openssl ca \ + -keyfile ca2-key.pem \ + -cert ca2-cert.pem \ + -config ca2.cnf \ + -gencrl \ + -out ca2-crl.pem + +clean: + rm -f *.pem *.srl ca2-database.txt ca2-serial + +test: agent1-verify agent2-verify agent3-verify agent4-verify + + +.PHONY: all clean test agent1-verify agent2-verify agent3-verify agent4-verify diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-cert.pem new file mode 100644 index 0000000..816f6fb --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKjCCAZMCCQDQ8o4kHKdCPDANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO +BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB9 +MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK +EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MTEgMB4G +CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL +ADBIAkEAnzpAqcoXZxWJz/WFK7BXwD23jlREyG11x7gkydteHvn6PrVBbB5yfu6c +bk8w3/Ar608AcyMQ9vHjkLQKH7cjEQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAKha +HqjCfTIut+m/idKy3AoFh48tBHo3p9Nl5uBjQJmahKdZAaiksL24Pl+NzPQ8LIU+ +FyDHFp6OeJKN6HzZ72Bh9wpBVu6Uj1hwhZhincyTXT80wtSI/BoUAW8Ls2kwPdus +64LsJhhxqj2m4vPKNRbHB2QxnNrGi30CUf3kt3Ia +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-csr.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-csr.pem new file mode 100644 index 0000000..748fd00 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-csr.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH +EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD +EwZhZ2VudDExIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAJ86QKnKF2cVic/1hSuwV8A9t45URMhtdce4JMnb +Xh75+j61QWwecn7unG5PMN/wK+tPAHMjEPbx45C0Ch+3IxECAwEAAaAlMCMGCSqG +SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB +AF+AfG64hNyYHum46m6i7RgnUBrJSOynGjs23TekV4he3QdMSAAPPqbll8W14+y3 +vOo7/yQ2v2uTqxCjakUNPPs= +-----END CERTIFICATE REQUEST----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-key.pem new file mode 100644 index 0000000..5dae7eb --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1-key.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBAJ86QKnKF2cVic/1hSuwV8A9t45URMhtdce4JMnbXh75+j61QWwe +cn7unG5PMN/wK+tPAHMjEPbx45C0Ch+3IxECAwEAAQJBAI2cU1IuR+4IO87WPyAB +76kruoo87AeNQkjjvuQ/00+b/6IS45mcEP5Kw0NukbqBhIw2di9uQ9J51DJ/ZfQr ++YECIQDUHaN3ZjIdJ7/w8Yq9Zzz+3kY2F/xEz6e4ftOFW8bY2QIhAMAref+WYckC +oECgOLAvAxB1lI4j7oCbAaawfxKdnPj5AiEAi95rXx09aGpAsBGmSdScrPdG1v6j +83/2ebrvoZ1uFqkCIB0AssnrRVjUB6GZTNTyU3ERfdkx/RX1zvr8WkFR/lXpAiB7 +cUZ1i8ZkZrPrdVgw2cb28UJM7qZHQnXcMHTXFFvxeQ== +-----END RSA PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1.cnf new file mode 100644 index 0000000..81d2f09 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent1.cnf @@ -0,0 +1,19 @@ +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = agent1 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-cert.pem new file mode 100644 index 0000000..8e4354d --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB7DCCAZYCCQC7gs0MDNn6MTANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO +BgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEgMB4GCSqGSIb3DQEJARYR +cnlAdGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEy +WjB9MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYD +VQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MjEg +MB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEF +AANLADBIAkEAyXb8FrRdKbhrKLgLSsn61i1C7w7fVVVd7OQsmV/7p9WB2lWFiDlC +WKGU9SiIz/A6wNZDUAuc2E+VwtpCT561AQIDAQABMA0GCSqGSIb3DQEBBQUAA0EA +C8HzpuNhFLCI3A5KkBS5zHAQax6TFUOhbpBCR0aTDbJ6F1liDTK1lmU/BjvPoj+9 +1LHwrmh29rK8kBPEjmymCQ== +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-csr.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-csr.pem new file mode 100644 index 0000000..a670c4c --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-csr.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH +EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD +EwZhZ2VudDIxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf ++6fVgdpVhYg5QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAaAlMCMGCSqG +SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB +AJnll2pt5l0pzskQSpjjLVTlFDFmJr/AZ3UK8v0WxBjYjCe5Jx4YehkChpxIyDUm +U3J9q9MDUf0+Y2+EGkssFfk= +-----END CERTIFICATE REQUEST----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-key.pem new file mode 100644 index 0000000..522903c --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2-key.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOgIBAAJBAMl2/Ba0XSm4ayi4C0rJ+tYtQu8O31VVXezkLJlf+6fVgdpVhYg5 +QlihlPUoiM/wOsDWQ1ALnNhPlcLaQk+etQECAwEAAQJBAMT6Bf34+UHKY1ObpsbH +9u2jsVblFq1rWvs8GPMY6oertzvwm3DpuSUp7PTgOB1nLTLYtCERbQ4ovtN8tn3p +OHUCIQDzIEGsoCr5vlxXvy2zJwu+fxYuhTZWMVuo1397L0VyhwIhANQh+yzqUgaf +WRtSB4T2W7ADtJI35ET61jKBty3CqJY3AiAIwju7dVW3A5WeD6Qc1SZGKZvp9yCb +AFI2BfVwwaY11wIgXF3PeGcvACMyMWsuSv7aPXHfliswAbkWuzcwA4TW01ECIGWa +cgsDvVFxmfM5NPSuT/UDTa6R5BFISB5ea0N0AR3I +-----END RSA PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2.cnf new file mode 100644 index 0000000..0a9f2c7 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent2.cnf @@ -0,0 +1,19 @@ +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = agent2 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-cert.pem new file mode 100644 index 0000000..e4a2350 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKjCCAZMCCQCDBr594bsJmTANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO +BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB9 +MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK +EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDzANBgNVBAMTBmFnZW50MzEgMB4G +CSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwXDANBgkqhkiG9w0BAQEFAANL +ADBIAkEAtlNDZ+bHeBI0B2gD/IWqA7Aq1hwsnS4+XpnLesjTQcL2JwFFpkR0oWrw +yjrYhCogi7c5gjKrLZF1d2JD5JgHgQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJoK +bXwsImk7vJz9649yrmsXwnuGbEKVYMvqcGyjaZNP9lYEG41y5CeRzxhWy2rlYdhE +f2nqE2lg75oJP7LQqfQY7aCqwahM3q/GQbsfKVCGjF7TVyq9TQzd8iW+FEJIQzSE +3aN85hR67+3VAXeSzmkGSVBO2m1SJIug4qftIkc2 +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-csr.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-csr.pem new file mode 100644 index 0000000..e6c0c74 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-csr.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH +EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD +EwZhZ2VudDMxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBALZTQ2fmx3gSNAdoA/yFqgOwKtYcLJ0uPl6Zy3rI +00HC9icBRaZEdKFq8Mo62IQqIIu3OYIyqy2RdXdiQ+SYB4ECAwEAAaAlMCMGCSqG +SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB +AEGo76iH+a8pnE+RWQT+wg9/BL+iIuqrcFXLs0rbGonqderrwXAe15ODwql/Bfu3 +zgMt8ooTsgMPcMX9EgmubEM= +-----END CERTIFICATE REQUEST----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-key.pem new file mode 100644 index 0000000..d72f071 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3-key.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBALZTQ2fmx3gSNAdoA/yFqgOwKtYcLJ0uPl6Zy3rI00HC9icBRaZE +dKFq8Mo62IQqIIu3OYIyqy2RdXdiQ+SYB4ECAwEAAQJAIk+G9s2SKgFa8y3a2jGZ +LfqABSzmJGooaIsOpLuYLd6eCC31XUDlT4rPVGRhysKQCQ4+NMjgdnj9ZqNnvXY/ +RQIhAOgbdltr3Ey2hy7RuDW5rmOeJTuVqCrZ7QI8ifyCEbYTAiEAyRfvWSvvASeP +kZTMUhATRUpuyDQW+058NE0oJSinTpsCIQCR/FPhBGI3TcaQyA9Ym0T4GwvIAkUX +TqInefRAAX8qSQIgZVJPAdIWGbHSL9sWW97HpukLCorcbYEtKbkamiZyrjMCIQCX +lX76ttkeId5OsJGQcF67eFMMr2UGZ1WMf6M39lCYHQ== +-----END RSA PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3.cnf new file mode 100644 index 0000000..26db5ba --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent3.cnf @@ -0,0 +1,19 @@ +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = agent3 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-cert.pem new file mode 100644 index 0000000..07157b9 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICSDCCAbGgAwIBAgIJAIMGvn3huwmaMA0GCSqGSIb3DQEBBQUAMHoxCzAJBgNV +BAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzANBgNVBAoTBkpveWVu +dDEQMA4GA1UECxMHTm9kZS5qczEMMAoGA1UEAxMDY2EyMSAwHgYJKoZIhvcNAQkB +FhFyeUB0aW55Y2xvdWRzLm9yZzAeFw0xMTAzMTQxODI5MTJaFw0zODA3MjkxODI5 +MTJaMH0xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTELMAkGA1UEBxMCU0YxDzAN +BgNVBAoTBkpveWVudDEQMA4GA1UECxMHTm9kZS5qczEPMA0GA1UEAxMGYWdlbnQ0 +MSAwHgYJKoZIhvcNAQkBFhFyeUB0aW55Y2xvdWRzLm9yZzBcMA0GCSqGSIb3DQEB +AQUAA0sAMEgCQQDN/yMfmQ8zdvmjlGk7b3Mn6wY2FjaMb4c5ENJX15vyYhKS1zhx +6n0kQIn2vf6yqG7tO5Okz2IJiD9Sa06mK6GrAgMBAAGjFzAVMBMGA1UdJQQMMAoG +CCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4GBAA8FXpRmdrHBdlofNvxa14zLvv0N +WnUGUmxVklFLKXvpVWTanOhVgI2TDCMrT5WvCRTD25iT1EUKWxjDhFJrklQJ+IfC +KC6fsgO7AynuxWSfSkc8/acGiAH+20vW9QxR53HYiIDMXEV/wnE0KVcr3t/d70lr +ImanTrunagV+3O4O +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-csr.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-csr.pem new file mode 100644 index 0000000..97e115d --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-csr.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBXTCCAQcCAQAwfTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQH +EwJTRjEPMA0GA1UEChMGSm95ZW50MRAwDgYDVQQLEwdOb2RlLmpzMQ8wDQYDVQQD +EwZhZ2VudDQxIDAeBgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAM3/Ix+ZDzN2+aOUaTtvcyfrBjYWNoxvhzkQ0lfX +m/JiEpLXOHHqfSRAifa9/rKobu07k6TPYgmIP1JrTqYroasCAwEAAaAlMCMGCSqG +SIb3DQEJBzEWExRBIGNoYWxsZW5nZSBwYXNzd29yZDANBgkqhkiG9w0BAQUFAANB +AMzo7GUOBtGm5MSck1rrEE2C1bU3qoVvXVuiN3A/57zXeNeq24FZMLnkDeL9U+/b +Kj646XFou04gla982Xp74p0= +-----END CERTIFICATE REQUEST----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-key.pem new file mode 100644 index 0000000..b770b01 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4-key.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOQIBAAJBAM3/Ix+ZDzN2+aOUaTtvcyfrBjYWNoxvhzkQ0lfXm/JiEpLXOHHq +fSRAifa9/rKobu07k6TPYgmIP1JrTqYroasCAwEAAQJAN8RQb+dx1A7rejtdWbfM +Rww7PD07Oz2eL/a72wgFsdIabRuVypIoHunqV0sAegYtNJt9yu+VhREw0R5tx/qz +EQIhAPY+nmzp0b4iFRk7mtGUmCTr9iwwzoqzITwphE7FpQnFAiEA1ihUHFT9YPHO +f85skM6qZv77NEgXHO8NJmQZ5GX1ZK8CICzle+Mluo0tD6W7HV4q9pZ8wzSJbY8S +W/PpKetm09F1AiAWTw8sAGKAtc/IGo3Oq+iuYAN1F8lolzJsfGMCGujsOwIgAJKP +t3eXilwX3ZlsDWSklWNZ7iYcfYrvAc3JqU6gFCE= +-----END RSA PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4.cnf new file mode 100644 index 0000000..5e583eb --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/agent4.cnf @@ -0,0 +1,21 @@ +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = agent4 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + +[ ext_key_usage ] +extendedKeyUsage = clientAuth diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.pem new file mode 100644 index 0000000..1951de7 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICazCCAdQCCQDTlFdg2h0DBjANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO +BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB6 +MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK +EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMTEgMB4GCSqG +SIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A +MIGJAoGBAKxbsLdJbi53pcP1pzg8lgJhLEvcNlV2ogr97WURp+gPjK+HFXj2xl9w +qDQrxpmvTya+urBG7OagTjV1E7dRE7PTr4TkEqehmxF026Opb0PZewuIBOKX4UgG +PSfk0fksrje6YJb+OkiBfA/q7eznZF8cmq7MRrs7LWe9A6Bic/apAgMBAAEwDQYJ +KoZIhvcNAQEFBQADgYEAk6hlYgjCBihG4dM+3324W1WsvjU8QscsTXu8SGL0y9b6 +82zZikj0W9FU6u98WHtXwuFt3mKlGCcou2pluZvj02T2iVKSMs2oYL8JOlvM8hVf +GEeg2EriLlzmdxNz4/I86DlBiyoTijZh8/qrItsK7+a56P0exH8ouXzlhL1Bhjw= +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.srl b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.srl new file mode 100644 index 0000000..046be14 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-cert.srl @@ -0,0 +1 @@ +D0F28E241CA7423C diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-key.pem new file mode 100644 index 0000000..a4e4516 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1-key.pem @@ -0,0 +1,17 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIrulhMUmafvECAggA +MBQGCCqGSIb3DQMHBAjsjahmkf3zGwSCAoANt0xX8ZZT2CxeyUadbOuku6NrHoFy +YBvnEFvuq3TGm3NB72BxprvfMUNR5Xi6e6rJgtRQttPRX6oN2qfB8+W11vFBeFWG +gxarEotklca4bujPMwxRowyMT20n+yXvRc+Fd5tYrMcaBeweQZD69J242HJMJJmq +Lzvo2qYGaOxjpc8aUDzeDsv8cnlh5Xk1ZcRucRPM9j26KOPSt0wOd4RdN83AE8cW +Xu+k5TSMlPQLWihjS+KzEQ8Rs9CuubxrdmecF6DM70u0kYCLZ1Ex7+kBZu06CUpJ +PODaLca4W92XkBq4X25WgAAaCAj4nZZmgn0X0Fwl1lBqjOK5nEnYpjxuwjjJ2KVz +3j+kBK5tW6RBE4BM37r7NiM1FAzi8sgNYSVS9oa4m1qGfadEEQdhaMsAfM0SZ/8M +6NUPKlQmoDda9aCO7rqRuQ7pYQ9mpNxcWEBQi0cG6/3VXtqi/TewAKT1T5DToAzg +pL4eOTqeDp4VKif5r2u7Nj0EiM4j2TT88onGsdgRtjgUpNmJCRWYaCzs3QZggdYE +nLZt7ZRXpJ11tERKG3b28qrIw9jHULRAjjWEkEGbxYTpAlrgXklV/04XXnxxAVOP +0YjDzbfx5QCRCq5UHV4Gl3ELoBaOuxcIIN8YrE2oC1CY9uV/HSk4CSlxHNtWyxbA +WbCU2SoEHnwBVlTPbZyfErM33c3u4LJyNx6ah7NzMh5AoQ+cPXlzxFBEGIyAmW37 +pItxDNwL1PzXHGpfOM/QZ5wjzGIwXsh8j94jDNB+TIMG4+dm4aXkolevPjJrYAeG +XZC5mvfMsntNGNFszT/8iXLwt7tlMlQQQl/2b5m6L5yffy6m39wGqTVa +-----END ENCRYPTED PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1.cnf new file mode 100644 index 0000000..ea43127 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca1.cnf @@ -0,0 +1,20 @@ +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +output_password = password + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = ca1 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.pem new file mode 100644 index 0000000..95e3041 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICazCCAdQCCQDVGbMO4Y2VUTANBgkqhkiG9w0BAQUFADB6MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAO +BgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlA +dGlueWNsb3Vkcy5vcmcwHhcNMTEwMzE0MTgyOTEyWhcNMzgwNzI5MTgyOTEyWjB6 +MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQK +EwZKb3llbnQxEDAOBgNVBAsTB05vZGUuanMxDDAKBgNVBAMTA2NhMjEgMB4GCSqG +SIb3DQEJARYRcnlAdGlueWNsb3Vkcy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0A +MIGJAoGBAMOOtRmmjoBZmyYreB1D1fjftMW6sEGBzfSKZRcn+kiEpqXELq21O/TV +jLJGbo+0PDqxECQyDbOgoQZXcCevFnFhdsSQOYb+0O2kAiMVYGxDtqoKM5g8wj0D +BiE6fnyZoQTDv5lEuvfG0+youCtXlxiK/9cfhikI+hVXuTgwQXt9AgMBAAEwDQYJ +KoZIhvcNAQEFBQADgYEAbMrLydFajwfZXDH3PfpKtDPCm+yV3qvEMGWLfjBdN50g +PwsZE/OIp+KJttdS+MjMG1TfwfWIqa5zGG2ctxx+fHsKH+t3NsO76Eol1p+dKqZp +PdFp2UhViMgURkrpP593AsTTO9BGaz+awSaESDHm8pO+cLaeGKQp93W0sgC0lHQ= +-----END CERTIFICATE----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.srl b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.srl new file mode 100644 index 0000000..00dca7d --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-cert.srl @@ -0,0 +1 @@ +8306BE7DE1BB099A diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-crl.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-crl.pem new file mode 100644 index 0000000..166df74 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-crl.pem @@ -0,0 +1,10 @@ +-----BEGIN X509 CRL----- +MIIBXTCBxzANBgkqhkiG9w0BAQQFADB6MQswCQYDVQQGEwJVUzELMAkGA1UECBMC +Q0ExCzAJBgNVBAcTAlNGMQ8wDQYDVQQKEwZKb3llbnQxEDAOBgNVBAsTB05vZGUu +anMxDDAKBgNVBAMTA2NhMjEgMB4GCSqGSIb3DQEJARYRcnlAdGlueWNsb3Vkcy5v +cmcXDTExMDMxNDE4MjkxNloXDTEzMTIwNzE4MjkxNlowHDAaAgkAgwa+feG7CZoX +DTExMDMxNDE4MjkxNFowDQYJKoZIhvcNAQEEBQADgYEArRKuEkOla61fm4zlZtHe +LTXFV0Hgo21PScHAp6JqPol4rN5R9+EmUkv7gPCVVBJ9VjIgxSosHiLsDiz3zR+u +txHemhzbdIVANAIiChnFct8sEqH2eL4N6XNUIlMIR06NjNl7NbN8w8haqiearnuT +wmnaL4TThPmpbpKAF7N7JqQ= +-----END X509 CRL----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-database.txt b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-database.txt new file mode 100644 index 0000000..a0966d2 --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-database.txt @@ -0,0 +1 @@ +R 380729182912Z 110314182914Z 8306BE7DE1BB099A unknown /C=US/ST=CA/L=SF/O=Joyent/OU=Node.js/CN=agent4/emailAddress=ry@tinyclouds.org diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-key.pem b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-key.pem new file mode 100644 index 0000000..49f678a --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-key.pem @@ -0,0 +1,17 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIbhsCgrscf9MCAggA +MBQGCCqGSIb3DQMHBAjz0LdWOB2KVQSCAoDu+sHRLP6v6QiEwqynnF43yP02/F+8 +Jssz6cgFPpm4MWm+xwzvMsS4ET0UYE68OTZz/QgihwH0mp/34tkUnP0HqtdbnTH1 +fkG47hb8fVSEyDQSzs1ha/u31GIachNURKyhWR5mr15AJxu2B94Z3ldNv1yjI+Fy +M1muuyx/cdkKTdpfpYr6n//wF1tup2u8Y7nkKsFus/mCuRlpItxKcRb1+nvW0s+K +3bSR8CTlEWd1Tx6Qx+ogRbP8gwqd6gelcz/Zj8nInx/Y0gTkQ4eodmLJ5iqsvC36 +SgQB5LuP12ujTyXB3Hwqb8LJ4lULERX6AYHAa7h0c+fxuFr0W9/8atplrd22hoiP +zZhgPHeH3R1fibB4M4xW2xgtbysOHj74RYlhQm1TCXLlqvzKkvT2oQ1bk7tUUqoR +ozRxVzdL9oKWLzvR4LF8S67i35JlnOPU1AhcxD2+5ywRvTpugPyCE1mZOeVLHlGW +2pdmSKbdd2gm2iSfadDPJ1DPdHLp844jRg/D6XDs4rlBnt9FjMWaXYo+ELmokoYe +Yljv2MGfy6zsb5iKcNsx+llu04xGXfZ9BAuG+aT6DLCIcDIVvE0d6asc4Lz1xZli +BrgyB8el2a/PomPbbf1vI2vtDi3Rg/pQhu/2++ODI08jI9Rudz1EltQQ4Lo38Ton +nSZegTAy6afXiEh2ty09KxMo4sWs+F2I46e5Q3zGY9b/K19bbQTFxeBf2Rfwa8BF +cf8Xs+DlcOMz5w0U2iBQfT1cV7dWLlaop7avYkpQ0fLa1pConlNhpguezcaAB8Lb +VCfpoTh6VfHRtCLokQlkq0mlKPUSlMr/JAyVdvppp/T6Abt0VirM9ILV +-----END ENCRYPTED PRIVATE KEY----- diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-serial b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-serial new file mode 100644 index 0000000..8a0f05e --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2-serial @@ -0,0 +1 @@ +01 diff --git a/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2.cnf b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2.cnf new file mode 100644 index 0000000..7af9f8c --- /dev/null +++ b/kitchenradio/node_modules/wget/node_modules/tunnel/test/keys/ca2.cnf @@ -0,0 +1,33 @@ +[ ca ] +default_ca = CA_default + +[ CA_default ] +serial = ca2-serial +crl = ca2-crl.pem +database = ca2-database.txt +name_opt = CA_default +cert_opt = CA_default +default_crl_days = 999 +default_md = md5 + + +[ req ] +default_bits = 1024 +days = 999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +output_password = password + +[ req_distinguished_name ] +C = US +ST = CA +L = SF +O = Joyent +OU = Node.js +CN = ca2 +emailAddress = ry@tinyclouds.org + +[ req_attributes ] +challengePassword = A challenge password + diff --git a/kitchenradio/node_modules/wget/package.json b/kitchenradio/node_modules/wget/package.json new file mode 100644 index 0000000..e17c3d2 --- /dev/null +++ b/kitchenradio/node_modules/wget/package.json @@ -0,0 +1,42 @@ +{ + "name": "wget", + "version": "0.0.1", + "description": "wget in nodejs.", + "keywords": [ + "download", + "http", + "https", + "ftp", + "proxy" + ], + "author": { + "name": "Chengwei Wu", + "email": "meegodevelop@gmail.com" + }, + "repository": { + "type": "git", + "url": "git://github.com/wuchengwei/node-wget.git" + }, + "main": "./index.js", + "bin": { + "nwget": "./bin/nwget.js" + }, + "dependencies": { + "tunnel": "0.0.2" + }, + "engines": { + "node": ">= 0.6.18" + }, + "readme": "node-wget\n=========\n\nwget in nodejs", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/wuchengwei/node-wget/issues" + }, + "homepage": "https://github.com/wuchengwei/node-wget", + "_id": "wget@0.0.1", + "dist": { + "shasum": "8bb81af0b8e60b5df262d3c81e5737e1f4931e53" + }, + "_from": "wget@*", + "_resolved": "https://registry.npmjs.org/wget/-/wget-0.0.1.tgz" +} diff --git a/kitchenradio/node_modules/wget/test/test.js b/kitchenradio/node_modules/wget/test/test.js new file mode 100644 index 0000000..9e5dbae --- /dev/null +++ b/kitchenradio/node_modules/wget/test/test.js @@ -0,0 +1,14 @@ +var wget = require('../lib/wget'); + +var download = wget.download('https://raw.github.com/Fyrd/caniuse/master/data.json', '/tmp/README.md'); +// with a proxy: +// var download = wget.download('https://raw.github.com/Fyrd/caniuse/master/data.json', '/tmp/README.md', {proxy: 'http://proxyhost:port'}); +download.on('error', function(err) { + console.log(err); +}); +download.on('end', function(output) { + console.log(output); +}); +download.on('progress', function(progress) { + console.log(progress); +}); \ No newline at end of file