From 8cb2a96aff2e4cdb5f672e3fe4f4b9b8dd8db37e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 1 Aug 2014 16:07:56 -0700 Subject: [PATCH] paypro: do not return error on untrusted cert. let peer decide whether to trust. --- js/models/core/Wallet.js | 11 +++++------ test/test.PayPro.js | 5 ----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 47646ab03..66079d834 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -874,11 +874,9 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { return PayPro.RootCerts.getTrusted(pem); }).filter(Boolean); - if (!trusted.length) { - if (typeof SSL_UNTRUSTED === 'undefined') { - return cb(new Error('Not a trusted certificate.')); - } - } + // if (!trusted.length) { + // return cb(new Error('Not a trusted certificate.')); + // } // Verify Signature var verified = pr.verify(); @@ -928,7 +926,8 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { merchant_data: merchant_data.toString('hex') }, signature: sig, - ca: ca + ca: ca, + untrusted: !ca }, request_url: options.uri, total: bignum('0', 10).toString(10) diff --git a/test/test.PayPro.js b/test/test.PayPro.js index eb819bff2..fcb3605dd 100644 --- a/test/test.PayPro.js +++ b/test/test.PayPro.js @@ -22,15 +22,10 @@ var Address = bitcore.Address; var PayPro = bitcore.PayPro; var startServer = require('./mocks/FakePayProServer'); -var G = is_browser ? window : global; -G.SSL_UNTRUSTED = true; - var server; describe('PayPro (in Wallet) model', function() { var config = { - // requiredCopayers: 3, - // totalCopayers: 5, requiredCopayers: 1, totalCopayers: 1, spendUnconfirmed: true,