PushSharp를 사용하여 앱에 푸시 알림을 보내려고합니다. 두 개의 Apple 계정이 있습니다. 하나는 일반 계정이고 다른 하나는 Enterprise 계정입니다. 정상적인 계정에 개발자 인증서가 있지만 내 개발 및 배포 인증서가 모두 Enterprise 계정에서 작동하지 않습니다. 나는 인증 예외를 얻을 ..iOS 푸시 알림 AuthenticationException
A call to SSPI failed, see inner exception.
Inner Exception:
[System.ComponentModel.Win32Exception]: {"An unknown error occurred while processing the certificate"}
이 (I 아웃 라인을 언급하지 않았다) PushSharp의 코드에서 발생 여기
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);
}
내 테스트 프로젝트에서 코드입니다 :
public static void SendPingToApple()
{
try
{
var devicetoken = "mytoken";
var appleCert = File.ReadAllBytes(AssemblyPathName + @"\Resources\DistPrivKey1.p12");
var push = new PushBroker();
push.RegisterAppleService(new ApplePushChannelSettings(IsProduction, appleCert, "password"));
push.QueueNotification(new AppleNotification()
.ForDeviceToken(devicetoken.ToUpper())
.WithAlert("Test Notification"));
push.StopAllServices();
}
catch (Exception ex)
{
throw;
}
}
openssl을 사용하여 엔터프라이즈 인증서를 사용하여 apns 서비스에 연결하려고 했습니까? 먼저 인증서에 문제가 없는지 확인하십시오. – Nilesh
아니요? 그것을하는 방법이 나에게 즉시 명백하지 않습니다. 당신은 정교 할 수 있습니까? –
다음 명령을 실행해야합니다. openssl s_client -connect gateway.sandbox.push.apple.com:2195 -Cert YourSSLCertAndPrivateKey.pem -debug -showcerts -CAfile "Entrust.net 인증 기관 (2048) .pem"다음에 따라 URL을 업데이트하십시오. 어떤 인증서를 사용하고 있습니까? 연결에 실패하면 인증서 또는 네트워크 구성에 문제가 있습니다. – Nilesh