Node.js 链中的自签名证书:Heroku nodeJS与paypal集成
我有一个运行在heroku上的应用程序,它是用NodeJS构建的 应用程序已与Paypal REST SDK集成 由于某些原因,有时在调用paypal sdk方法后,我会收到错误消息“SELF_SIGNED_CERT_IN_CHAIN” 应用程序重新启动后,此错误似乎也消失了 调用方法是直截了当的,90%的时间都可以正常工作Node.js 链中的自签名证书:Heroku nodeJS与paypal集成,node.js,ssl,heroku,paypal,dnsimple,Node.js,Ssl,Heroku,Paypal,Dnsimple,我有一个运行在heroku上的应用程序,它是用NodeJS构建的 应用程序已与Paypal REST SDK集成 由于某些原因,有时在调用paypal sdk方法后,我会收到错误消息“SELF_SIGNED_CERT_IN_CHAIN” 应用程序重新启动后,此错误似乎也消失了 调用方法是直截了当的,90%的时间都可以正常工作 // Bluebird promisified paypal.create function // Payment object is usual paypal objec
// 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: }
method=GET path=“/api/v1/orders/create/1/multiple”请求id=ef4d2b98-7060-4049-9c72-13d58bd14184状态=500字节=246
Jun 04 04:39:17 app/web.2:请求问题:链中的自签名证书
Jun 04 04:39:17 app/web.2:{
Jun 04 04:39:17 app/web.2:“级别”:“错误”,
Jun 04 04:39:17 app/web.2:“消息”:“错误:SecurePair上的自签名证书链中\n”
任何帮助或建议都将不胜感激
谢谢
Gevorg您应该为他人添加相关代码段以获得帮助!@AADTechnical,感谢您的回复,我已经添加了代码段。您应该为他人添加相关代码段以获得帮助!@AADTechnical,感谢您的回复,我已经添加了代码段。您应该为他人添加相关代码段以获得帮助!@AADTechnical,感谢您的回复,我已经添加了code代码段。