-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.js
52 lines (45 loc) · 1.66 KB
/
generate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* This code is closed source and Confidential and Proprietary to
* Appcelerator, Inc. All Rights Reserved. This code MUST not be
* modified, copy or otherwise redistributed without expression
* written permission of Appcelerator. This file is licensed as
* part of the Appcelerator Platform and governed under the terms
* of the Appcelerator license agreement.
*/
// verify from browser at https://www.grc.com/fingerprints.htm
const DOMAINS = [
'security.appcelerator.com',
// pre-production
'de7a3ab4b12bf1d3d4b7fde7f306c11bc2b98f67.cloudapp-enterprise-preprod.appctest.com',
// production
'4503ef0cc4daae71d3bb898f66c72b886c9f6d61.cloudapp-enterprise.appcelerator.com',
];
// if you run this file from the command line, will generate fresh fingerprints from
// the DOMAINS array above
// SECURITY WARNING: only run this and trust the responses if you're sure you're not
// in a man in the middle situation. this assumes that the fingerprints returned are
// trusted
if (module.id === ".") {
var request = require('request-ssl'),
async = require('async'),
fs = require('fs'),
path = require('path'),
dir = path.join(__dirname,'fingerprints');
async.eachSeries(DOMAINS, function(domain, cb){
console.log('-> checking',domain);
request.getFingerprintForURL(domain, function(err,fingerprint){
if (err) { return cb(err); }
if (!domain) { return cb("Couldn't get fingerprint for "+domain); }
var fn = path.join(dir, domain);
console.log(domain+' fingerprint => ',fingerprint);
fs.writeFile(fn, fingerprint, cb);
});
}, function(err){
if (err) {
console.error(err);
process.exit(1);
}
});
}
// export for testing
exports.DOMAINS = DOMAINS;