29

アプリを App Store で販売する準備ができましたが、実稼働デバイス (App Store からアプリをインストールしたデバイス) のいずれもプッシュ通知を受け取りません。プロダクション デバイスにプッシュ通知を送信しようとすると、次のエラーが発生します。

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

この例外は内部的にスローされ、無限ループでキャッチされます。

ここに画像の説明を入力

ApplePushChannel.csファイルの 539 行目でスローされます。

    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 の出力でのアプリケーションの出力です。

...
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)

私が試したことは次のとおりです。

  • 試しているデバイス ID が実稼働デバイス トークンに登録されていることを再確認しました。
  • APNS Production 証明書を取り消して再生成し、秘密鍵を使用して新しい.p12ファイルにエクスポートし、新しい証明書で再試行しました。(私は開発プッシュ通知で同じ問題を抱えていましたが、これで問題が解決しました)
  • SSL プロトコルを からSsl3に変更しましたTls。(数日前にプロトコルバージョンに問題があり、問題を一時的に修正しました。これは必要ないはずですが、発生しているエラーは、これが修正される前に発生していたエラーと同じです)
  • 開発サーバー/証明書ではなく、実稼働証明書を使用して実際に実稼働サーバーに接続しようとしていることを確認しました。
  • APNS サーバーに直接アクセスできることを確認しました (私の ASP.NET アプリは、私の Mac の Parallels VM Windows 8.1 内にあります。混乱を避けるために、ここに私の Mac からの出力を示します。

(端末出力) 編集: サンドボックス サーバーに ping を実行していました。運用サーバーにも ping を実行しました。接続できることも確認したので、問題ではありません。

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 サーバーとネゴシエートしないのはなぜですか?

4

6 に答える 6

1

Windows 証明書ストアを使用する場合 (本番サーバーで証明書を管理する最も簡単な方法です)、秘密鍵に正しいアクセス許可を設定してください。

于 2016-01-21T15:03:34.037 に答える
1

答えはどれも私にとってはうまくいきませんでした。最終的に私がやったのは、証明書と秘密鍵を Windows 証明書ストアにインポートし、.pfx.

于 2017-02-15T11:07:54.517 に答える
0

私は同じ例外を受け取っていました。私の場合は、IOS プッシュ サービス証明書のアクセス許可を追加する必要がありました。

mmc で証明書を右クリック -> すべてのタスク -> 秘密鍵の管理... Web アプリの iis アプリケーション プールがそのアカウントを使用していたため、NETWORK SERVICE を追加しました。

詳細については、http: //blog.falafel.com/apple-push-notifications-certificates-and-iis/を参照してください。

于 2016-01-25T15:33:17.483 に答える