我有一个在使用 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
任何帮助或建议将不胜感激。
谢谢格沃格