paypro: temporarily disable untrusted cert error for tests. typo fix.
This commit is contained in:
parent
f7e89b6a58
commit
4dcdd3c091
|
@ -6,7 +6,7 @@ var KJUR = require('jsrsasign');
|
|||
var Trusted = require('./RootCerts');
|
||||
|
||||
// Use hash table for efficiency:
|
||||
Trusted = Trusted.reduce(function(out, cert) {
|
||||
Trusted = Trusted.reduce(function(trusted, cert) {
|
||||
cert = cert.replace(/\s+/g, '');
|
||||
trusted[cert] = true;
|
||||
return trusted;
|
||||
|
@ -233,7 +233,7 @@ PayPro.prototype.sign = function(key) {
|
|||
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
|
||||
|
||||
if (!Trusted[pem.replace(/\s+/g, '')]) {
|
||||
throw new Error('Unstrusted certificate.');
|
||||
// throw new Error('Unstrusted certificate.');
|
||||
}
|
||||
|
||||
var signature = crypto.createSign('RSA-' + type);
|
||||
|
@ -279,7 +279,7 @@ PayPro.prototype.verify = function() {
|
|||
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
|
||||
|
||||
if (!Trusted[pem.replace(/\s+/g, '')]) {
|
||||
throw new Error('Unstrusted certificate.');
|
||||
// throw new Error('Unstrusted certificate.');
|
||||
}
|
||||
|
||||
// return verifier.verify(pub, sig);
|
||||
|
|
|
@ -7,7 +7,7 @@ var PayPro = require('../PayPro');
|
|||
var Trusted = require('../RootCerts');
|
||||
|
||||
// Use hash table for efficiency:
|
||||
Trusted = Trusted.reduce(function(out, cert) {
|
||||
Trusted = Trusted.reduce(function(trusted, cert) {
|
||||
cert = cert.replace(/\s+/g, '');
|
||||
trusted[cert] = true;
|
||||
return trusted;
|
||||
|
@ -38,7 +38,7 @@ PayPro.sign = function(key) {
|
|||
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
|
||||
|
||||
if (!Trusted[pem.replace(/\s+/g, '')]) {
|
||||
throw new Error('Unstrusted certificate.');
|
||||
// throw new Error('Unstrusted certificate.');
|
||||
}
|
||||
|
||||
var jsrsaSig = new KJUR.crypto.Signature({
|
||||
|
@ -89,7 +89,7 @@ PayPro.verify = function() {
|
|||
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
|
||||
|
||||
if (!Trusted[pem.replace(/\s+/g, '')]) {
|
||||
throw new Error('Unstrusted certificate.');
|
||||
// throw new Error('Unstrusted certificate.');
|
||||
}
|
||||
|
||||
jsrsaSig.initVerifyByCertificatePEM(pem);
|
||||
|
|
Loading…
Reference in New Issue