我有一個數據服務託管在天藍色從我發送通知到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證書有問題。請幫助我,我被卡住
也試過但是同樣的錯誤。 我有正確的證書和密碼是有什麼問題代碼 –