小编Rah*_*ate的帖子

apns sharp中的iPhone证书错误对SSPI的调用失败

我有一个托管在azure的数据服务,我正在向iphone发送通知,但在与apns建立连接时,我收到以下错误"对SSPI的调用失败.收到的消息是意外的或格式错误." 我也提到了相同错误的链接,但仍然收到错误

苹果推送通知与APNS sharpC#iPhone推送服务器?

        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(), …
Run Code Online (Sandbox Code Playgroud)

iphone azure apple-push-notifications apns-sharp

7
推荐指数
1
解决办法
7497
查看次数