2014-11-04 3 views
2

임 다음 유효 P12과 애플 푸쉬 통지를 송신 토큰을 시도하는 원격 호스트에 의해 폐쇄 된 전송 접속으로부터 데이터를 판독 할 수 없습니다APNS C#을 제외한 기존 연결 강제

void connect() 
     { 
      client = new TcpClient(); 

      //Notify we are connecting 
      var eoc = this.OnConnecting; 
      if (eoc != null) 
       eoc(this.appleSettings.Host, this.appleSettings.Port); 

      try 
      { 
       client.Connect(this.appleSettings.Host, this.appleSettings.Port); 
      } 
      catch (Exception ex) 
      { 
       throw new ConnectionFailureException("Connection to Host Failed", ex); 
      } 

      if (appleSettings.SkipSsl) 
      { 
       networkStream = client.GetStream(); 
      } 
      else 
      { 
       stream = new SslStream(client.GetStream(), false, 
        new RemoteCertificateValidationCallback((sender, cert, chain, sslPolicyErrors) => { return true; }), 
        new LocalCertificateSelectionCallback((sender, targetHost, localCerts, remoteCert, acceptableIssuers) => 
        { 
         return certificate; 
        })); 

       try 
       { 
        stream.AuthenticateAsClient(this.appleSettings.Host, this.certificates, System.Security.Authentication.SslProtocols.Tls, false); 
        //stream.AuthenticateAsClient(this.appleSettings.Host); 
       } 
       catch (System.Security.Authentication.AuthenticationException ex) 
       { 
        throw new ConnectionFailureException("SSL Stream Failed to Authenticate as Client", ex); 
       } 

       if (!stream.IsMutuallyAuthenticated) 
        throw new ConnectionFailureException("SSL Stream Failed to Authenticate", null); 

       if (!stream.CanWrite) 
        throw new ConnectionFailureException("SSL Stream is not Writable", null); 

       networkStream = stream; 
      } 

      //Start reading from the stream asynchronously 
      Reader(); 
     } 

    } 

내가 변경된 때 회선 코드 : System.Security.Authentication.SslProtocols.Tls to System.Security.Authentication.SslProtocols.Ssl3 "원격 파티가 전송 스트림을 닫았 기 때문에 인증에 실패했습니다."

어떻게 APNS를 보낼 수 있습니까? 어떻게 apns를 보낼 수 있습니까 ???

답변

1

주요 보안 결함으로 인해 지난 달 (2014 년 10 월)에 SSL3이 (다른 사람들에게) 배포되었습니다. POODLE (다운 로딩 레거시 암호화에서 패딩).

+0

좋아, Tls를 사용하는 중 오류는 어떻게됩니까? –