3
try
{
    _apnsStream.AuthenticateAsClient("gateway.sandbox.push.apple.com", certificates, System.Security.Authentication.SslProtocols.Ssl3, false);
}

I am getting this error "A call to SSPI failed, see inner exception" at the above line while using Moon-Apns dll in my .net web service... can any one suggest me to solve this issue.

Jon
  • 4,746
  • 2
  • 24
  • 37
nagender
  • 46
  • 1
  • 3
  • I just had this. Turned out that my development certificate had expired. Have you checked on the Developer portal that your app ID still has this enabled? – Robert Oct 17 '13 at 14:43
  • Can you please elobrate it a bit more. What do you mean by development certificate had expired? see my similar question here: http://stackoverflow.com/questions/20265853/pushsharp-apns-service-stop-working-after-windows-shutdown – muhammad kashif Nov 29 '13 at 04:47

4 Answers4

2

Change:

System.Security.Authentication.SslProtocols.Ssl3

to:

System.Security.Authentication.SslProtocols.Tls 
Wyetro
  • 8,439
  • 9
  • 46
  • 64
JCLopez
  • 101
  • 1
  • 3
1

use production certificate and not development certificate.

use gateway.push.apple.com instead of gateway.sandbox.push.apple.com

AND System.Security.Authentication.SslProtocols.Ssl3 to System.Security.Authentication.SslProtocols.Tls

Pop
  • 12,135
  • 5
  • 55
  • 68
Digvijay Machale
  • 601
  • 7
  • 12
0

I do not know if this will be helpful after a year, but I leave the answer for iOS8.

Apple has changed the server security and right on the line you mention, you have to change from SSL to TLS:

Original code:

_apnsStream.AuthenticateAsClient(host,certificates,System.Security.Authentication.SslProtocols.Ssl3, false); 

New code:

_apnsStream.AuthenticateAsClient(host,certificates,System.Security.Authentication.SslProtocols.Tls, false);

I hope this information is helpful to someone.

Someone commented this in the GIT forum

Stornu2
  • 2,284
  • 3
  • 27
  • 47
0

I faced same issue currently, The reason was whatever .p12 given/assigned in ASP.net script in back end that .p12 file's corresponding certificate of push notification in keychain was expired, i simply created new developer certificate in and new developer provisioning profile then exported the .p12 file on newly created developer certificate and given to back end developer he assigned that new .p12 in his script, i assigned the newly created provisioning profile in my xcode. and it worked.

iShwar
  • 1,625
  • 1
  • 16
  • 31