Ces*_*are 1 php ssl apache2.4 telegram telegram-bot
我是电报中的新手,我正在尝试用它来完成我的第一步.
我在这里找到了一个很好的教程https://www.youtube.com/watch?v=hJBYojK7DO4:我用PHP和SSL配置了我的Apache 2.4,一切正常,也是教程中的示例.
当我尝试放入浏览器时,麻烦正在使用setWebhook方法....
https://api.telegram.org/<my_bot_code>/setWebHook?url=https://localhost/Telegram/MyYouTubeTutorialBot/YouTubeTutorialBot.php
Run Code Online (Sandbox Code Playgroud)
反应是
{"ok":false,"error_code":400,"description":"Error: Bad webhook: Error: Ip is reserved"}
Run Code Online (Sandbox Code Playgroud)
请注意,我正在使用自生成的证书....
我在api Telegram文档中找到了(参考https://core.telegram.org/bots/faq#i-39m-having-problems-with-webhooks),
" .....要使用自签名证书,您需要使用setWebhook中的certificate参数上传您的公钥证书.请上传为InputFile,发送字符串将无效. "
我不明白如何上传我的公钥证书文件......任何地方的例子?
问题可能是因为我使用localhost和我的本地Apache 的默认IP地址127.0.0.1?我应该使用每次连接到网络时更改的当前更改我的IP地址(我使用互联网密钥将我连接到网络.....)?
非常感谢你提前
小智 6
使用以下简单的HTML代码
<html>
<body>
<form action="https://api.telegram.org/bot<BOT_TOCKEN>/setwebhook" method="post" enctype="multipart/form-data">
Select Certificate to upload:
<input type="file" name="certificate" id="fileToUpload">
URL: <input type="text" name="url" value="https://<YOURWEBSITE>/<YOUR_PHP_URL>"><br>
<input type="submit" value="Upload Certificate" name="submit">
</form>
</body>
</html>Run Code Online (Sandbox Code Playgroud)