https
express server läuft jetzt mit https
This commit is contained in:
52
express-server/node_modules/.bin/certpem
generated
vendored
Normal file
52
express-server/node_modules/.bin/certpem
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
var certpem = require('../').certpem;
|
||||
var path = require('path');
|
||||
var filepath = (process.cwd() + path.sep + 'cert.pem');
|
||||
var debug = false;
|
||||
var json;
|
||||
var cert;
|
||||
|
||||
if (/--debug/.test(process.argv[2]) || /--debug/.test(process.argv[3])) {
|
||||
debug = true;
|
||||
}
|
||||
if (/--json/.test(process.argv[2]) || /--json/.test(process.argv[3])) {
|
||||
json = true;
|
||||
}
|
||||
if (process.argv[2] && !/^--/.test(process.argv[2])) {
|
||||
filepath = process.argv[2];
|
||||
}
|
||||
if (process.argv[3] && !/^--/.test(process.argv[3])) {
|
||||
filepath = process.argv[3];
|
||||
}
|
||||
|
||||
if (filepath.length > 256) {
|
||||
cert = filepath;
|
||||
}
|
||||
else {
|
||||
cert = require('fs').readFileSync(filepath, 'ascii');
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
console.info(JSON.stringify(certpem.debug(cert), null, ' '));
|
||||
} else {
|
||||
var c = certpem.info(cert);
|
||||
|
||||
if (json) {
|
||||
console.info(JSON.stringify(c, null, ' '));
|
||||
return;
|
||||
}
|
||||
|
||||
console.info('');
|
||||
|
||||
console.info('Certificate for', c.subject);
|
||||
console.info('');
|
||||
console.info('Altnames:', c.altnames.join(', '));
|
||||
console.info('');
|
||||
console.info('Issued at', new Date(c.issuedAt));
|
||||
console.info('Expires at', new Date(c.expiresAt));
|
||||
|
||||
console.info('');
|
||||
}
|
33
express-server/node_modules/.bin/mkdirp
generated
vendored
Normal file
33
express-server/node_modules/.bin/mkdirp
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var mkdirp = require('../');
|
||||
var minimist = require('minimist');
|
||||
var fs = require('fs');
|
||||
|
||||
var argv = minimist(process.argv.slice(2), {
|
||||
alias: { m: 'mode', h: 'help' },
|
||||
string: [ 'mode' ]
|
||||
});
|
||||
if (argv.help) {
|
||||
fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
var paths = argv._.slice();
|
||||
var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
|
||||
|
||||
(function next () {
|
||||
if (paths.length === 0) return;
|
||||
var p = paths.shift();
|
||||
|
||||
if (mode === undefined) mkdirp(p, cb)
|
||||
else mkdirp(p, mode, cb)
|
||||
|
||||
function cb (err) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
else next();
|
||||
}
|
||||
})();
|
35
express-server/node_modules/.bin/rsa-keygen-js
generated
vendored
Normal file
35
express-server/node_modules/.bin/rsa-keygen-js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var RSA = require('../').RSA;
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
var bitlen = 2048;
|
||||
var exp = 65537;
|
||||
var opts = { public: true, pem: true };
|
||||
var cwd = process.cwd();
|
||||
var privkeyPath = path.join(cwd, 'privkey.pem');
|
||||
var pubkeyPath = path.join(cwd, 'pubkey.pem');
|
||||
|
||||
if (fs.existsSync(privkeyPath)) {
|
||||
console.error(privkeyPath, "already exists");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
RSA.generateKeypair(bitlen, exp, opts, function (err, keypair) {
|
||||
console.info('');
|
||||
console.info('');
|
||||
|
||||
fs.writeFileSync(privkeyPath, keypair.privateKeyPem, 'ascii');
|
||||
console.info(privkeyPath + ':');
|
||||
console.info('');
|
||||
console.info(keypair.privateKeyPem);
|
||||
|
||||
console.info('');
|
||||
|
||||
fs.writeFileSync(pubkeyPath, keypair.publicKeyPem, 'ascii');
|
||||
console.info(pubkeyPath + ':');
|
||||
console.info('');
|
||||
console.info(keypair.publicKeyPem);
|
||||
});
|
Reference in New Issue
Block a user