我想将Windows Laragon用于Telegram机器人与webhook
我将let's encrypt用于活动的SSL certificate
我使用手动验证创建的.well-known文件下载了zip证书,并将其替换为

/etc/appache2/sll.


现在当我想使用https://developerpiel.com(我的域)浏览器时,请向我显示ssl is actived by letsencrypt。我用了

https://api.telegram.org/bot(token)/setWebhookurl=https://developerpie.com/robot/bot.php


和它回报我

{
  "ok": true,
  "result": true,
  "description": "Webhook is already set"
}


但是当我想使用Telegram api方法时,无法从Telegram webhook接收任何数据。
我认为如果请求自动重定向到HTTPS而不是HTTP会解决

如何在Windows上配置Laragon

我找到答案的一半编辑:

<VirtualHost *:80>
ServerName www.developerpie.com
Redirect permanent / https://www.developerpie.com/
</VirtualHost>
<VirtualHost _default_:443>
    <Directory "C:/laragon/www/">
        AllowOverride All
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile      C:/laragon/etc/ssl/laragon.crt
    SSLCertificateKeyFile   C:/laragon/etc/ssl/laragon.key
</VirtualHost>


我现在在加载网站时使用此配置,自动浏览器会自动重定向到https,但Telegram Web挂钩仍无法正常工作

最佳答案

这是您来自Telegram服务器的结果:

{
  "ok": true,
  "result": {
    "url": "https://developerpie.com/robot/bot.php",
    "has_custom_certificate": false,
    "pending_update_count": 21,
    "last_error_date": 1566230202,
    "last_error_message": "SSLrror {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}",
    "max_connections": 40
  }
}


这张图片是SSLShoppre.com通过SSL测试的结果
apache - 我如何在Laragon中将HTTP重定向到HTTPS-LMLPHP
因此,请遵循此link

09-27 03:13
查看更多