using (TcpClient client = new TcpClient()) { string appleurl="gateway.push.apple.com"; string pushpath = @"D:\App_Data\AppPush.p12"; client.Connect(appleurl, 2195); X509Certificate clientCertificate = new X509Certificate(pushpath); X509CertificateCollection clientCertificateCollection = new X509CertificateCollection(new X509Certificate[1] { clientCertificate }); SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null); try { sslStream.AuthenticateAsClient(appleurl, clientCertificateCollection, SslProtocols.Default, false); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)