Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

[Bug?]: 发送 https://multimedia.nt.qq.com.cn/ 域名的图片时会报错 #315

@xuetu0606

Description

@xuetu0606

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述内容
  • 我已经使用 最新构建 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

e55ed79

运行环境

Linux

运行架构

x64

连接方式

反向 WebSocket

重现步骤

使用 nonebot.adapters.onebot.v11 发送图片时报错
图片地址
https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgozMjk2MTMyNjUxEhTB9IpgDFjncZODQma9FBjGqwpbshjOkZEBIP8KKMmI2cWLwYUDUIC9owE&rkey=CAQSMLhE1BzKB7G4ezEtcO-3ZHqMrrDifo2LG1uDFAQqKmt_fSXf_tw4XCUmD6TeiQGDyg&spec=0
能正常访问
image

期望的结果是什么?

能够正常发送图片.并且不会再次执行上传图片的行为

实际的结果是什么?

发送报错,并没有发送成功图片消息
这个是报错信息
image

简单的复现代码/链接(可选)

# 框架规则
from nonebot import on_command
# 通讯协议
from nonebot.adapters.onebot.v11 import MessageSegment

# 随机图片
image = on_command('随机图片')


@image.handle()
async def _():
    url = 'https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgozMjk2MTMyNjUxEhTB9IpgDFjncZODQma9FBjGqwpbshjOkZEBIP8KKMmI2cWLwYUDUIC9owE&rkey=CAQSMLhE1BzKB7G4ezEtcO-3ZHqMrrDifo2LG1uDFAQqKmt_fSXf_tw4XCUmD6TeiQGDyg&spec=0'
    await image.send(MessageSegment.image(url))
    await image.finish()

日志记录(可选)

info: Lagrange.Core.BotContext[0]
      [2024-04-14 14:39:56] [MessagingLogic] [VERBOSE]: [MessageChain(761290459)(3218366812)] [Text]: 随机图片trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[1]
      [ReverseWSService] Send: {"message_type":"group","sub_type":"normal","message_id":93102705,"group_id":761290459,"user_id":3218366812,"anonymous":null,"message":[{"type":"text","data":{"text":"\u968F\u673A\u56FE\u7247"}}],"raw_message":"\u968F\u673A\u56FE\u7247","font":0,"sender":{"user_id":3218366812,"nickname":"\u96EA\u5154","card":"","sex":"unknown","age":0,"area":"","level":"83","role":"owner","title":""},"time":1713076796,"self_id":3296132651,"post_type":"message"}
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2]
      [ReverseWSService] Receive: {"action": "send_msg", "params": {"user_id": 3218366812, "group_id": 761290459, "message_type": "group", "message": [{"type": "image", "data": {"file": "https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=CgozMjk2MTMyNjUxEhTB9IpgDFjncZODQma9FBjGqwpbshjOkZEBIP8KKMmI2cWLwYUDUIC9owE&rkey=CAQSMLhE1BzKB7G4ezEtcO-3ZHqMrrDifo2LG1uDFAQqKmt_fSXf_tw4XCUmD6TeiQGDyg&spec=0", "type": null, "cache": "true", "proxy": "true", "timeout": null}}]}, "echo": "1"}
warn: Lagrange.OneBot.Core.Operation.OperationService[0]
      Unexpected error encountered while handling message.
      System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.)
       ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
       ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
       ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.
       ---> Interop+Crypto+OpenSslCryptographicException: error:0A000410:SSL routines::sslv3 alert handshake failure
         --- End of inner exception stack trace ---
         at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, ReadOnlySpan`1 input, Byte[]& sendBuf, Int32& sendCount)
         at System.Net.Security.SslStreamPal.HandshakeInternal(SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
         --- End of inner exception stack trace ---
         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.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
         at Lagrange.OneBot.Message.Entity.CommonResolver.ResolveStream(String url)
         at Lagrange.OneBot.Message.Entity.ImageSegment.Build(MessageBuilder builder, SegmentBase segment)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.BuildMessages(MessageBuilder builder, List`1 segments)
         at Lagrange.OneBot.Core.Operation.Message.MessageCommon.ParseChain(OneBotMessage message)
         at Lagrange.OneBot.Core.Operation.Message.SendMessageOperation.HandleOperation(BotContext context, JsonNode payload)
         at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[1]
      [ReverseWSService] Send: {"status":"failed","retcode":200,"data":null,"echo":"1"}
trce: Lagrange.Core.BotContext[0]
      [2024-04-14 14:39:58] [ServiceContext] [DEBUG]: Outgoing SSOFrame: Heartbeat.Alive
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[1]
      [ReverseWSService] Send: {"interval":5000,"status":{"app_initialized":true,"app_enabled":true,"app_good":true,"online":true,"good":true},"meta_event_type":"heartbeat","time":1713076799,"self_id":3296132651,"post_type":"meta_event"}
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[1]
      [ReverseWSService] Send: {"interval":5000,"status":{"app_initialized":true,"app_enabled":true,"app_good":true,"online":true,"good":true},"meta_event_type":"heartbeat","time":1713076804,"self_id":3296132651,"post_type":"meta_event"}
trce: Lagrange.Core.BotContext[0]

补充说明(可选)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug?Maybe it's a bugwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions