Skip to content

在无法使用TLS时,小米天气无法正常访问 #1569

Description

@liuziheng20091106

检查清单

  • 我已更新到最新版 最新的版本号最新的版本号 测试,并看过 最新提交,确认这一 Bug 还没有修复。我也已在 Issues 中检索,确认这一 Bug 未被提交过,并且在 常见问题 中没有解决方案。
  • 我已经仔细阅读过选项里的内容,并且知道这个选项不用勾选。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题(关于其他非程序本身的问题应当在 Discussion 板块提出)。

期望的行为

在烟台一中通过小米api获取天气信息。

实际结果

在极个别网络环境中中,https访问小米天气api会出现神秘的,随机的〔远程主机积极的拒绝响应〕(好像是怎么说的)

只有通过http协议访问时不会出错(已通过修改代码自行编译测试,证实可行)

重现步骤

来到烟台一中

任选一个班的电脑

尝试刷新天气
or
尝试通过浏览器访问https://weatherapi.market.xiaomi.com

尝试通过openssl测试weatherapi.market.xiaomi.com的协议

尝试访问http://weatherapi.market.xiaomi.com

截图/录屏(可选,建议)

No response

堆栈跟踪(可选)

2025/12/24 6:32:07|Warning|ClassIsland.Helpers.WebRequestHelper|Json GET 请求失败(第 0 次重试)https://weatherapi.market.xiaomi.com/wtr-v3/location/city/geo?longitude=***&latitude=***&locale=zh_cn
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.IO.IOException: Unable to read data from the transport connection: 远程主机强迫关闭了一个现有的连接。.
 ---> System.Net.Sockets.SocketException (10054): 远程主机强迫关闭了一个现有的连接。
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
   at System.Net.Security.SslStream.ReceiveHandshakeFrameAsync[TIOAdapter](CancellationToken cancellationToken)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionWithTelemetryAsync(HttpRequestMessage request, HttpConnectionPool pool, Boolean async, CancellationToken requestCancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.Metrics.MetricsHandler.SendAsyncWithMetrics(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Sentry.SentryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at ClassIsland.Helpers.WebRequestHelper.GetJson[T](Uri uri, Int32 retries, Nullable`1 cancellationToken, Boolean verifySign, String publicKey) in /_/ClassIsland/Helpers/WebRequestHelper.cs:line 37

诊断信息

Windows 10 2021 LTSC或Windows 10 2017 Pro
程序以管理员身份/普通身份运行
程序存放于C盘,D盘,我的文档,用户文件夹等位置
CI版本1.7.0.5或2.0.0.1
多种网络环境下,持续3个月反复测试。

最后一步

  • 我认为上述的描述已经足以详细,以允许开发人员能复现该问题。如果我的 issue 没有按照上述的要求填写,可能会被无条件关闭。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug在使用 ClassIsland 的过程中遇到了 Bug优先级:无短期内不会计划完成的事项待查看等待开发者查看此 Issue需要人工分类

    Type

    Fields

    开发周期

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions