Telegram Bot Webhook不验证我的SSL证书

时间:2018-02-09 10:37:39

标签: curl ssl-certificate telegram telegram-bot telegram-webhook

我的网站上有可靠的SSL证书版本3.我从SSL发卡机构获得了4个文件,其中一个是放在服务器上的域证书。

为我的机器人设置webhook我尝试过:

  1. 网址模式下的简单setWebhook方法:

    setWebhook
  2. --insecure使用Curl。我已经从证书发行者上传了4个文件中的每个文件,也包含了随机顺序包含所有4个文件的文件。 (curl命令将我的证书识别为自签名并返回SSL(60)错误,因此我必须在命令中添加curl --insecure -F "url=https://example.com/webhookMethod" -F "certificate=@cert.pem" https://api.telegram.org/bot447278997:****************************nZW0/setWebhook 字以忽略证书的验证并发送它)。这是命令:

    getWebhookInfo
  3. 上面没有一个方法让我的webhook工作。调用{ "ok":true, "result":{ "url":"https://example.com/webhookMethod", "has_custom_certificate":true, "pending_update_count":7, "last_error_date":1518169667, "last_error_message":"Wrong response from the webhook: 302 Found", "max_connections":40 } } 方法,我每次都会收到错误:

    has_custom_certificate

    在某些尝试中False变为last_error_messagenot verified certificate变为SSL error var schema = { attr1: { type: String, required: true }, attr2: { type: String, required: true }, attr3: { type: Number, required: true } 等等。

    此外,我已经使用邮递员进行SSL验证测试了我的网络服务,并且所有设置和工作都已完成。 我也知道Telegram不支持SSL版本2和3,但支持自签名证书。既然我已经向他们发送了经过验证的版本3证书,那么它应该可以正常工作,对吗?

    提前感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

它不是ssl问题。你应该在不是302的响应中返回200.据我所知302意味着重定向。不要重定向响应消息。

相关问题