PushSharp APNS生产:提供给包的凭据无法识别(开发工作正常,虽然) [英] PushSharp APNS production: The credentials supplied to the package were not recognized (development works fine though)

查看:1295
本文介绍了PushSharp APNS生产:提供给包的凭据无法识别(开发工作正常,虽然)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用刚刚准备在App Store中出售,但没有我的生产设备(即已经安装了App Store中的设备)越来越推送通知。当我尝试推送通知发送到生产设备,我得到这个错误:

My app just got ready for sale on App Store, but none of my production devices (devices that have installed the app from App Store) are getting push notifications. When I try to send a push notification to a production device, I am getting this error:

"The credentials supplied to the package were not recognized" 
(System.ComponentModel.Win32Exception)

这异常被抛出内部并陷入了一个死循环:

This exception is internally thrown and caught in an infinite loop:

这是在 ApplePushChannel.cs 文件的539行抛出:

It is thrown at line 539 of ApplePushChannel.cs file:

    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);
}

这是在Visual Studio输出应用程序的输出:

This is the output of the application in Visual Studio Output:

...
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
...(it keeps getting thrown until I stop it manually)

下面是我尝试过的事情:

Here are the things I've tried:


  • 双重检查,我试图将设备ID与生产设备标记注册。

  • 吊销和再生的APNS生产合格证,用私钥到一个新的的.p12 文件中导出它,并用新的证书再次尝试。 (我有发展推送通知了同样的问题,这解决了我的问题)

  • 改变SSL协议从 SSL3 TLS 。 (前几天有一个与协议版本的问题,它解决的问题暂时不应该有需要为这个,但我得到的错误是一样的对视了一眼我得到这个固定它之前)

  • 检查说我实际上是试图与生产证书,而不是开发服务器/证书连接到生产服务器。

  • 经过,我可以直接访问APNS服务器(我的ASP.NET应用程序住在Parallels虚拟机的Windows 8.1在里面我的Mac,这里是我的Mac输出,只是为了避免混淆:

  • Double checked that the device ID I'm trying is registered with a production device token.
  • Revoked and regenerated the APNS Production certificate, exported it with the private key to a new .p12 file, and tried again with the new certificate. (I had the same problem with development push notifications, and this solved my problem)
  • Changed the SSL protocol from Ssl3 to Tls. (a few days ago there was a problem with protocol version, and it fixed a problem temporarily. There shouldn't be need for this, but the error I'm getting is the same as the one I was getting before which this fixed)
  • Checked that I'm actually trying to connect to production server with the production certificate instead of development server/certificate.
  • Checked that I can access the APNS server directly (my ASP.NET app lives inside a Parallels VM Windows 8.1 at my Mac, here is the output from my Mac, just to avoid confusion:

(端子输出)
编辑:我是查验沙箱服务器,我ping的生产服务器,我确认我可以连接到它了,所以这不是问题

(Terminal output) I was pinging the sandbox server, I've pinged the production server, I verify that I can connect to it too, so it's not the issue.

can$ sudo nmap -p 2195 gateway.sandbox.push.apple.com
Starting Nmap 6.40-2 ( http://nmap.org ) at 2014-04-28 00:06 EEST
Nmap scan report for gateway.sandbox.push.apple.com (17.149.34.189)
Host is up (0.49s latency).
Other addresses for gateway.sandbox.push.apple.com (not scanned): 17.149.34.187 17.149.34.188
PORT     STATE SERVICE
2195/tcp open  unknown

为什么PushSharp与APNS服务器谈判?

Why would PushSharp not negotiate with APNS servers?

推荐答案

我想通了这个问题。我撤销,并再次重新生成证书,这一次我只导出私钥(无证书)。在钥匙串访问,我导出为的.p12 并使用新的文件和它的工作。出于某种原因,PushSharp没有玩好的.p12 当两个证书和私钥在文件中present。

I figured out the problem. I revoked and regenerated the certificate again, and this time I only exported the private key (without the certificate). In Keychain access, I exported as .p12 and used the new file and it worked. For some reason, PushSharp wasn't play well with .p12 when both certificate and private key are present in the file.

这篇关于PushSharp APNS生产:提供给包的凭据无法识别(开发工作正常,虽然)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆