SELF_SIGNED_CERT_IN_CHAIN:Heroku nodeJS与paypal集成

时间:2015-06-06 15:07:43

标签: node.js ssl heroku paypal dnsimple

我在使用NodeJS构建的heroku上运行了一个应用程序

应用程序使用Paypal与Paypal REST SDK集成

出于某种原因,有时在调用paypal sdk方法后,我收到“SELF_SIGNED_CERT_IN_CHAIN”消息的错误。

在重新启动应用程序后,似乎此错误消失了。

调用方法很简单,90%的时间没有任何问题

// Bluebird promisified paypal.create function
// Payment object is usual paypal object descibed in Paypal NodeJS SDK samlpes
// https://github.com/paypal/PayPal-node-SDK/blob/master/samples/payment/create_with_paypal.js

paypal.payment.create(paymentObj)
.then(function(result) {
   // handle result and redirect user to paypal confirm page
})
// Handle errors
.catch(function(err) {
    log.error(err.stack);

    res.status(500).json({
        message: err.message
    });
});

这是错误堆栈

method=GET path="/api/v1/orders/create/1/multiple" request_id=ef4d2b98-7060-4049-9c72-13d58bd14184  status=500 bytes=246 

Jun 04 04:39:17 app/web.2:  problem with request: SELF_SIGNED_CERT_IN_CHAIN 
Jun 04 04:39:17 app/web.2:  { 
Jun 04 04:39:17 app/web.2:    "level": "error", 
Jun 04 04:39:17 app/web.2:    "message": "  Error: SELF_SIGNED_CERT_IN_CHAIN\n    at SecurePair.<anonymous> (tls.js:1381:32)\n    at SecurePair.emit (events.js:92:17)\n    at SecurePair.maybeInitFinished (tls.js:980:10)\n    at CleartextStream.read [as _read] (tls.js:472:13)\n    at CleartextStream.Readable.read (_stream_readable.js:341:10)\n    at EncryptedStream.write [as _write] (tls.js:369:25)\n    at doWrite (_stream_writable.js:226:10)\n    at writeOrBuffer (_stream_writable.js:216:5)\n    at EncryptedStream.Writable.write (_stream_writable.js:183:11)\n    at write (_stream_readable.js:602:24)\n    at flow (_stream_readable.js:611:7)\n    at Socket.pipeOnReadable (_stream_readable.js:643:5)\n    at Socket.emit (events.js:92:17)\n    at emitReadable_ (_stream_readable.js:427:10)\n    at emitReadable (_stream_readable.js:423:5)\n    at readableAddChunk (_stream_readable.js:166:9)" 
Jun 04 04:39:17 app/web.2:  }

SSL证书通过DNSimple购买并根据本文进行设置 https://devcenter.heroku.com/articles/ssl-certificate-dnsimple

非常感谢任何帮助或建议。

由于 格沃尔格

0 个答案:

没有答案