【问题标题】:Facebook Mesenger Platform - Setting Up Your Webhook - Error - write EPROTO 1975128920 - third_party/boringssl/src/ssl/tls_record.cc:242Facebook Messenger 平台 - 设置 Webhook - 错误 - 写入 EPROTO 1975128920 -third_party/boringssl/src/ssl/tls_record.cc:242
【发布时间】:2020-08-03 00:51:48
【问题描述】:

我试图使用 facebook messenger 问题。我被 FB 建议创建一个快速节点 js 服务器应用程序来验证 web 钩子的地方卡住了。

在某一时刻,文档建议执行此命令。

> curl --insecure -X GET
> "http://localhost:1337/webhook?hub.verify_token=<TOKENSTRING>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe"

我遇到这样的错误

在视觉工作室 curl 请求中。

write EPROTO 1975128920:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242:

直接卷曲

Forbidden

【问题讨论】:

    标签: node.js facebook curl facebook-messenger


    【解决方案1】:

    最终没有找到直接的解决方案,发现问题出在这行代码上。

    app.listen(process.env.PORT || 1337, () => console.log('webhook is listening' + process.env.PORT));
    

    由于某种原因,在我的计算机上,默认端口未定义。然而,代码并没有跳过并选择 1337。它继续在未定义的端口上运行服务器,我猜基本上没有运行它。

    我把代码改成了这个。

    app.listen(1337, () => console.log('webhook is listening' + process.env.PORT));
    

    这解决了问题。

    我已将完整代码的副本放在这里 - https://github.com/Jay-study-nildana/FBMessengerWebHook,如果有人想使用它。

    另外,看看这个 curl 命令

    curl --insecure -X GET "http://localhost:1337/webhook?hub.verify_token=<token>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe"
    

    我还认为 --insecure 有所作为,因为默认情况下,至少在我的计算机上,curl 一直在寻找端点的 https 版本,而这在代码开发时根本不可用。

    【讨论】:

      猜你喜欢
      • 2020-10-20
      • 1970-01-01
      • 2016-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-16
      • 2016-08-09
      相关资源
      最近更新 更多