gpt4 book ai didi

ios - Apple 推送通知收到错误身份验证失败,因为远程方已关闭传输流

转载 作者:可可西里 更新时间:2023-11-01 04:38:35 25 4
gpt4 key购买 nike

我收到以下错误“身份验证失败,因为远程方已关闭传输流”

在ling代码之后:stream.AuthenticateAsClient(this.appleSettings.Host, this.certificates, System.Security.Authentication.SslProtocols.Ssl3, false);

它指向一个有效的 p.12

void connect()
{
client = new TcpClient();

//Notify we are connecting
var eoc = this.OnConnecting;
if (eoc != null)
eoc(this.appleSettings.Host, this.appleSettings.Port);

try
{
client.Connect(this.appleSettings.Host, this.appleSettings.Port);
}
catch (Exception ex)
{
throw new ConnectionFailureException("Connection to Host Failed", ex);
}

if (appleSettings.SkipSsl)
{
networkStream = client.GetStream();
}
else
{
stream = new SslStream(client.GetStream(), false,
new RemoteCertificateValidationCallback((sender, cert, chain, sslPolicyErrors) => { return true; }),
new LocalCertificateSelectionCallback((sender, targetHost, localCerts, remoteCert, acceptableIssuers) =>
{
return certificate;
}));

try
{
stream.AuthenticateAsClient(this.appleSettings.Host, this.certificates, System.Security.Authentication.SslProtocols.Ssl3, false);
//stream.AuthenticateAsClient(this.appleSettings.Host);
}
catch (System.Security.Authentication.AuthenticationException ex)
{
throw new ConnectionFailureException("SSL Stream Failed to Authenticate as Client", ex);
}

if (!stream.IsMutuallyAuthenticated)
throw new ConnectionFailureException("SSL Stream Failed to Authenticate", null);

if (!stream.CanWrite)
throw new ConnectionFailureException("SSL Stream is not Writable", null);

networkStream = stream;
}

//Start reading from the stream asynchronously
Reader();
}

}

最佳答案

stream.AuthenticateAsClient(this.appleSettings.Host, this.certificates, System.Security.Authentication.SslProtocols.Ssl3, false);

https://developer.apple.com/news/?id=10222014a

Apple 推送服务器不再支持 SSL3。尝试将其更改为 .Default 或 .TLS,它应该可以工作。

关于ios - Apple 推送通知收到错误身份验证失败,因为远程方已关闭传输流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26714413/

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