Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TenPayV3退款失败, Senparc.Weixin.Exceptions.WeixinException: The SSL connection could not be established, see inner exception #3109

Open
4 of 32 tasks
wenzhili opened this issue Dec 27, 2024 · 3 comments

Comments

@wenzhili
Copy link

此版块专为反馈 bug 及提交需求服务,不负责解答开发问题,请勿发表开发问题,
如果您需要这方面的帮助,请移步问答社区https://weixin.senparc.com/QA

问题描述

以前退款也正常的, 这次升级成 .net core 9.0 后, 相应的组件, 也升级成下方的最新版本了, 微信支付也是正常的, 就是退款失败.

TenPayV3退款失败, Senparc.Weixin.Exceptions.WeixinException: The SSL connection could not be established, see inner exception

Senparc.Weixin.Exceptions.WeixinException: The SSL connection could not be established, see inner exception. Senparc.Weixin.Exceptions.WeixinException: 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.
---> System.ComponentModel.Win32Exception (0x8009030D): 没有识别提供给安全包的凭证
at System.Net.SSPIWrapper.AcquireCredentialsHandle(ISSPIInterface secModule, String package, CredentialUse intent, SCHANNEL_CRED* scc)
at System.Net.Security.SslStreamPal.AcquireCredentialsHandle(CredentialUse credUsage, SCHANNEL_CRED* secureCredential)
at System.Net.Security.SslStreamPal.AcquireCredentialsHandleSchannelCred(SslAuthenticationOptions authOptions)
at System.Net.Security.SslStreamPal.AcquireCredentialsHandle(SslAuthenticationOptions sslAuthenticationOptions, Boolean newCredentialsRequested)
--- End of inner exception stack trace ---
at System.Net.Security.SslStreamPal.AcquireCredentialsHandle(SslAuthenticationOptions sslAuthenticationOptions, Boolean newCredentialsRequested)
at System.Net.Security.SslStream.AcquireCredentialsHandle(SslAuthenticationOptions sslAuthenticationOptions, Boolean newCredentialsRequested)
at System.Net.Security.SslStream.AcquireClientCredentials(Byte[]& thumbPrint, Boolean newCredentialsRequested)
at System.Net.Security.SslStream.GenerateToken(ReadOnlySpan1 inputBuffer, Int32& consumed) at System.Net.Security.SslStream.NextMessage(ReadOnlySpan1 incomingBuffer, Int32& consumed)
at System.Net.Security.SslStream.ProcessTlsFrame(Int32 frameSize)
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.InjectNewHttp11ConnectionAsync(QueueItem queueItem)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Senparc.CO2NET.HttpUtility.RequestUtility.HttpResponsePost(IServiceProvider serviceProvider, String url, CookieContainer cookieContainer, Stream postStream, Dictionary2 fileDictionary, String refererUrl, Encoding encoding, ApiClient apiClient, String certName, Boolean useAjax, Dictionary2 headerAddition, Int32 timeOut, Boolean checkValidationResult, Boolean hasFormData, String contentType) at Senparc.CO2NET.HttpUtility.RequestUtility.HttpPost(IServiceProvider serviceProvider, String url, CookieContainer cookieContainer, Stream postStream, Dictionary2 fileDictionary, String refererUrl, Encoding encoding, ApiClient apiClient, String certName, Boolean useAjax, Dictionary`2 headerAddition, Int32 timeOut, Boolean checkValidationResult, Boolean hasFormData, String contentType)
at Senparc.Weixin.TenPay.V3.TenPayV3.CertPost_NetCore(IServiceProvider serviceProvider, String mchId, String subMchId, String data, String url, Int32 timeOut)
at Senparc.Weixin.TenPay.V3.TenPayV3.Refund(IServiceProvider serviceProvider, TenPayV3RefundRequestData dataInfo, Int32 timeOut)
at Senparc.Weixin.MP.Sample.Controllers.tenpayv3Controller.Refund(String outTradeNo, Int32 totalFee, Int32 refundFee, String key)
--- End of inner exception stack trace ---

就算把引用信息改成以前正常用的, 也是同样报上面的错误. 是不是跟升级成 .net core 9.0 有关系? 以前的是.net core 8.0





重现问题步骤(如果可以)
  1. ...
  2. ...
微信官方文档 URL
微信官方文档快照(直接复制关键内容到下方)
发现问题的模块
  • Senparc.Weixin 版本:
  • Senparc.Weixin.MP 版本:
  • Senparc.Weixin.MP.MVC 版本:
  • Senparc.Weixin.Open 版本:
    - [ ] Senparc.Weixin.QY 版本:
  • Senparc.Weixin.Work 版本:
  • Senparc.Weixin.WxOpen 版本:
  • Senparc.Weixin.Cache.Redis 版本:
  • Senparc.Weixin.Cache.Memcached 版本:
  • Senparc.Weixin.Tenpay 版本:
  • Senparc.WebSocket 版本:
  • 其他模块:
模块对应的 .net 版本
  • .net 3.5
  • .net 4.0
  • .net 4.5+
  • .net standard 2.0 / 2.1
  • .net core 1.x
  • .net core 2.x
  • .net core 3.x
  • .net 5.x / 6.x
  • .net core 9.0
开发环境
  • Visual Studio 2019
  • Visual Studio 2022
  • Visual Studio Code
  • 其他:
缓存环境
  • 服务器内存缓存(默认)
  • Redis 版本:
  • Memcached 版本:
  • 其他:
系统环境
  • Windows,版本:
  • Linux,版本:
  • Mac,版本:
  • 其他:
联系方式

Email:[email protected]

(也可将问题地址及联系方式发送到 [email protected]

发布问题后,请保持对 issue 的关注,有时会有需要进一步沟通的信息,很长时间内没有得到答复的 issue 将被关闭。

@wenzhili
Copy link
Author

PixPin_2024-12-27_13-50-15
这是新的引用组件版本

PixPin_2024-12-27_13-50-28
这是以前旧的引用组件版本

@JeffreySu
Copy link
Owner

JeffreySu commented Dec 27, 2024

@wenzhili 看一下在网络配置、默认证书设置等外部环境的变化。和程序内部应该没有关系。

关注一下错误信息:没有识别提供给安全包的凭证

@wenzhili
Copy link
Author

谢谢你的回复, 我换了一台阿里云服务器, 以前也是能正常退费的, 也是最近升级到 .net core 9.0, 同样的也是一样的报错.
这一台服务器上的网络配置、默认证书设置之类的肯定没有变过, 因为是我自己管理的,唯一有变过的就是换成了 .net core 9.0 , 也没有用到docker之类的技术, 就是简单的asp.net core应用。
后来同样的程序, 我把版本从.net core 9.0 回退到 .net core 8.0 , 其他的代码都没动, 更新上去就能正常退款了,你们可以试试自己的Sample升级到 9.0 能不能退款。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants