【问题标题】:How can i redirect HTTP to HTTPS in laragon如何在 laragon 中将 HTTP 重定向到 HTTPS
【发布时间】:2019-12-23 11:53:57
【问题描述】:

我想将 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 网络挂钩仍然不起作用

【问题讨论】:

  • 如果您的 SSL 是有效的,所以不要担心 SSL 。它是绿色的,应该可以正常工作。在您的机器人上单击 /start 并通过 file_put_contents() 登录 webhook 并给我结果。您也可以通过 Telegram @GameO7er 联系我
  • 如何使用 file_put_contents() 方法
  • {"ok":true,"result":{"url":"developerpie.com/robot/… 错误 {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}","max_connections":40 }}
  • 我有 ssl 错误,但我的网站由letsencrypt 认证

标签: apache ssl redirect telegram laragon


【解决方案1】:

这是来自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 测试结果 所以请关注link

【讨论】:

    猜你喜欢
    • 2015-04-23
    • 2010-09-05
    • 1970-01-01
    • 2016-04-07
    • 2018-05-17
    • 1970-01-01
    • 1970-01-01
    • 2014-06-11
    相关资源
    最近更新 更多