我有一个数据服务托管在天蓝色从我发送通知到iPhone,但与APN建立连接我得到以下错误 “一个调用SSPI失败。收到的消息意外或格式不正确。“我也refered以下为同样的错误链接,但仍然得到错误apns尖锐iPhone证书错误SSPI呼叫失败
apple push notification with APNS sharp和 C# iPhone push server?
try
{
using (TcpClient client = new TcpClient())
{
try
{
client.Connect("gateway.sandbox.push.apple.com", 2195);
Logging("TSSLProDi :Connected to Apple");
}
catch (Exception ex)
{
Logging("TSSLProDi :" + ex.Message + "-IE-" + ex.InnerException);
}
using (NetworkStream networkStream = client.GetStream())
{
Logging("TSSLProDi :Client connected.");
X509Certificate clientCertificate = new X509Certificate(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory + @"startup\certname.pfx"), "mycertpassword");
X509CertificateCollection clientCertificateCollection = new X509CertificateCollection(new X509Certificate[1] { clientCertificate });
// Create an SSL stream that will close the client's stream.
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback(validateServerCertificate),
null
);
try
{
sslStream.AuthenticateAsClient("gateway.sandbox.push.apple.com", clientCertificateCollection, System.Security.Authentication.SslProtocols.Default, false);
Logging("TSSLProDi :slStreamAuthenticated");
}
catch (AuthenticationException ex)
{
Logging("TSSLProDi :" + "Exception: " + ex.Message.ToString());
if (ex.InnerException != null)
{
Logging("Inner exception: " + ex.InnerException.Message.ToString());
}
Logging("TSSLProDi :" + "Authentication failed - closing the connection.");
client.Close();
return;
}
}
}
}
catch (Exception ex)
{
Logging("TSSLProCert :" + ex.Message + "-IE-" + ex.InnerException);
}
我已经安装了必要的证书上的VM还。 一个警告我越来越iphone的developer_identity证书,我从苹果得到的是,“Windows没有足够的信息来验证此证书”是否有我的iPhone证书有问题。请帮助我,我被卡住
也试过但是同样的错误。 我有正确的证书和密码是有什么问题代码 –