title: MDM Server certificate to be used for SSL handshake with iPhone device
body: <p>I am trying to perform SSL Handshake between the iPhone device and my MDM Server. I have used iPhone configuration Utility (iPCU) and configured SCEP and MDM. SCEP works fine, the device receives the issued certificate from the CA. </p>
  
  <p>In the MDM Payload, I have used the subject of the APNS certificate in the topic and entered the server IP with port 1234. As an identity, I have used the identity of the SCEP Certificate. </p>
  
  <p>The iPhone generates the key and enrolls successfully, but then when it tries to install the profile by contacting the MDM server, I receive this error in the IPCU console:
  <strong>The server certificate for https://[IP here]:1234 is invalid</strong></p>
  
  <p>In my MDM Server application which is programmed using C#.NET complains that <strong>AuthenticationException:the SSPI has failed because the context has expired and can no longer be used.</strong> So my question is, what certificate should I have on my MDM server - is it the MDM certificate received from the iOS Provision portal, the Apple push certificate of the customer or the certificate of the SCEP Server?</p>
  
  <p>If someone could answer this question, I would be really grateful as I Have spent hours and I can't figure it out.</p>