locked
Calling Secure Webservices (HTTPS) using compact framework 2.0 RRS feed

  • Question

  • Dear All.

    My webservices are deployed with "https" on the server. I am not able to call webservice from mobile device using compact framework 2.0. On calling webservice error displays as "Could not establish secure channel for SSL/TLS".

    I have referred: http://msdn.microsoft.com/en-us/library/bb738067.aspx#DeviceCertificateVerification but it also didn't work.

     I have installed the certificate so on the web broswer on the device I am able to access but from device I am not able to access.

    On microsoft website I also found this code but this does not work at all:

    public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
    {
     public TrustAllCertificatePolicy()
     {}

     public bool CheckValidationResult(ServicePoint sp,
      X509Certificate cert,WebRequest req, int problem)
     {
      return true;
     }
    }

    Please suggest.

    Wednesday, May 9, 2012 7:34 AM

All replies

  • Hello,

     

    First, did you try the sample codes in that document?

     

    Second, I think your certificate file may have some problem. Make sure it is  the DER encoded binary X.509 format.

     

    Third, try to include the certificate file in this way.

    http://social.msdn.microsoft.com/Forums/en-US/windowsmobiledev/thread/91b9a26e-ddf6-4d48-b96a-14e31058a0d6

    Using codes or using certinstaller.exe

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 10, 2012 11:04 AM
  • Dear Jesse,

    Thanks a lot for reply.. But after installing the certificate it is also not working. As mentioned below there is no way of passing the certificate to the server. I have seen this code on most of the site but that does not work. How to pass certificate to the server?

    public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy{
     public TrustAllCertificatePolicy()
     {}

     public bool CheckValidationResult(ServicePoint sp,
      X509Certificate cert,WebRequest req, int problem)
     {
      return true;
     }
    }

    Saturday, May 12, 2012 10:31 AM