paypro: more root certs cleanup.
This commit is contained in:
parent
575352dd03
commit
4319395aa8
@ -144,7 +144,7 @@ var createTestData = function() {
|
|||||||
|
|
||||||
var createTrusted = function(callback) {
|
var createTrusted = function(callback) {
|
||||||
var cp = require('child_process');
|
var cp = require('child_process');
|
||||||
var ps = cp.spawn('/bin/bash', ['./browser/generate-trusted.sh'], {
|
var ps = cp.spawn('/bin/bash', ['./browser/root-certs'], {
|
||||||
customFds: [0, 1, 2],
|
customFds: [0, 1, 2],
|
||||||
cwd: __dirname + '/..'
|
cwd: __dirname + '/..'
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Grab the node root certs. This will be our trusted certs file.
|
|
||||||
|
|
||||||
# Mozilla Root Certs
|
|
||||||
# https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/included/
|
|
||||||
# https://raw.githubusercontent.com/joyent/node/master/tools/certdata.txt
|
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/joyent/node/master/src/node_root_certs.h \
|
|
||||||
|| curl -OJ https://raw.githubusercontent.com/joyent/node/master/src/node_root_certs.h
|
|
||||||
|
|
||||||
mv node_root_certs.h lib/RootCerts.js
|
|
||||||
pushd lib &> /dev/null
|
|
||||||
|
|
||||||
sed -i '$s/,$//g' RootCerts.js
|
|
||||||
|
|
||||||
echo "var RootCerts = ["$'\n'"$(cat RootCerts.js)" > RootCerts.js
|
|
||||||
echo "];" >> RootCerts.js
|
|
||||||
|
|
||||||
sed -i 's/^"/+ "/g' RootCerts.js
|
|
||||||
sed -i 's/^+ "-----B/"-----B/g' RootCerts.js
|
|
||||||
|
|
||||||
cat <<EOF >> RootCerts.js
|
|
||||||
// Use hash table for efficiency:
|
|
||||||
RootCerts = RootCerts.reduce(function(trusted, cert) {
|
|
||||||
cert = cert.replace(/\s+/g, '');
|
|
||||||
trusted[cert] = true;
|
|
||||||
return trusted;
|
|
||||||
}, {});
|
|
||||||
module.exports = RootCerts;
|
|
||||||
EOF
|
|
||||||
|
|
||||||
popd &> /dev/null
|
|
||||||
Loading…
Reference in New Issue
Block a user