forked from muhammaddadu/appc-request-ssl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.js
68 lines (59 loc) · 2.45 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* 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 = [
// Production domains
'dashboard.appcelerator.com',
'api.cloud.appcelerator.com',
'admin.cloudapp.appcelerator.com',
'security.cloud.appcelerator.com',
'software.appcelerator.com',
// registry and security server which will need to be updated once we move into prod
'3a3597615eabd843c6a04b5b650778dbe2feb975.cloudapp-enterprise-preprod.appctest.com',
'9bcfd7d35d3f2ad0ad069665d0120b7a381f81e9.cloudapp.appcelerator.com',
'de7a3ab4b12bf1d3d4b7fde7f306c11bc2b98f67.cloudapp-enterprise-preprod.appctest.com',
'4503ef0cc4daae71d3bb898f66c72b886c9f6d61.cloudapp-enterprise.appcelerator.com',
'27fe40d4c11c2bd6187b5d74ae8ceba06844539a.cloudapp-enterprise.appcelerator.com',
'8d2938f67044d8367d468453b5a6c2536185bcea.cloudapp-enterprise-preprod.appctest.com',
'4db53bb79d364bf3ea0595f95cb2bd1d55f355cb.cloudapp-enterprise.appcelerator.com',
// Test / Pre-production domains
'admin.cloudapp-enterprise-preprod.appctest.com',
'preprod-api.cloud.appctest.com',
'360-preprod.cloud.appctest.com',
'dolphin-api.cloud.appctest.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;