gpt4 book ai didi

node.js - Facebook 信使 API "URL COULD NOT BE VALIDATED"

转载 作者:IT老高 更新时间:2023-10-28 23:08:41 26 4
gpt4 key购买 nike

我正在尝试设置 Facebook Messenger API,但在尝试添加 WebHook 时出现此错误:

The URL couldn't be validated. Callback verification failed with the following errors: curl_errno = 60; curl_error = SSL certificate problem: unable to get local issuer certificate; HTTP Status Code = 200; HTTP Message = Connection established

我已经使用他们在教程中提供的代码设置了我的 NodeJS 服务器。这是网址:https://stackoverload.me/chatter/webhook

在此处编辑解决方案(有人想查看代码):

var express = require('express');

var fs = require('fs');
var https = require('https');

var app = express();
app.use(express.static('public'));

// SSL
https.createServer(
{
ca: fs.readFileSync(__dirname + '/server.ca'),
key: fs.readFileSync(__dirname + '/server.key'),
cert: fs.readFileSync(__dirname + '/server.cert')
}
, app).listen(443, function() {
console.log('Server is now running.');
});

// HTTP redirect to SSL
express()
.get('*', function(req,res){
res.redirect('https://example.com' + req.url)
})
.listen(80);

最佳答案

忘了回答这个问题,但我发现我在我的 https 服务器中添加了一个 ca 文件和参数,然后 Facebook 接受了它。

关于node.js - Facebook 信使 API "URL COULD NOT BE VALIDATED",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36582434/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com