gpt4 book ai didi

java - Telegram SendMessage 私有(private) channel - 收到致命警报 : handshake_failure

转载 作者:行者123 更新时间:2023-12-01 18:30:44 24 4
gpt4 key购买 nike

该代码直到上周才有效。现在我收到 handshake_failure 错误,但我不知道到底为什么,如果能提供一些帮助,我们将不胜感激!

String urlString = "https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s";

String channelName = "-100123456789"; // ex.

urlString = String.format(urlString, apiToken, channelName, message);

URL url = new URL(urlString);
URLConnection conn = url.openConnection();

StringBuilder sb = new StringBuilder();
InputStream is = new BufferedInputStream(conn.getInputStream());
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String inputLine = "";
while ((inputLine = br.readLine()) != null) {
sb.append(inputLine);
}
String response = sb.toString();

最佳答案

自上周以来,telegram 已停止使用 TLS 1.1 和 1.0,现在仅支持 TLS 1.2,因此您需要升级。

Please note that the Bot API only accepts incoming TLS 1.2 connections (or higher). Kindly update your bot if it was using the outdated TLS 1.0 or TLS 1.1 protocol.

https://t.me/BotNews/51

关于java - Telegram SendMessage 私有(private) channel - 收到致命警报 : handshake_failure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60171487/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com