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);
}