2

A call to SSPI failed, see inner exception. the context has expired and can no longer be used.

what does this error mean?

I have a certificate on my MDM server, and the device gets its identity certificate from SCEP. I am trying to install the config profile with MDM and SCEP but to no avail. The console tells me the certificate for the MDM server is invalid.

What I find strange is that the device logs into the MDM URL and I perform 'authenticateasserver' and it works, the stream is authenticated. once i click to install the profile for MDM, i get the above error.

 Console.WriteLine("Listening for clients...");
                TcpClient tcpClient = tcpListener.AcceptTcpClient();
                Stream s = tcpClient.GetStream();
                clientSSLStream = new SslStream(s, false, ValidateRemoteCertificate);

                try
                {
                    clientSSLStream.AuthenticateAsServer(cert, false, SslProtocols.Default, false);

                    if (clientSSLStream.IsAuthenticated)
                    {
                        Console.WriteLine("iPhone client is authenticated");
                    }
                    Console.WriteLine("iPhone Client connected");
                    string messagest = ReadMessage(clientSSLStream);

                    Payloads payloads = AddPayloads();
                    XDocument XMLPayloads = payloads.Generate();
                    string text = System.IO.File.ReadAllText("MDM Profile NEW.mobileconfig");
                    string XMLData = generateStringFromXML(XMLPayloads);
                    //string XMLData = "<html> <body><b>Hello</b> World</html>";
                    byte[] requestData = Headers.SendPOST(MDMServer.serverURL, text);
                    clientSSLStream.Write(requestData);
                }
michelle
  • 2,759
  • 4
  • 31
  • 46
  • Did u solve this one? i'm getting same error.I'm doing apple push notification server in .net.My EmailId-tejaprakashp@gmail.com. plz help me. – Tej Jan 25 '13 at 07:13
  • i needed to use a certificate with a root authority and then install the root certificate on the iphone device. add this as part of the certificate payload – michelle Mar 07 '13 at 08:56

0 Answers0