Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

SSl Problem on windows mobile with C#

Options
  • 20-03-2013 2:35pm
    #1
    Registered Users Posts: 7,500 ✭✭✭


    Ive developed a C# application which works fine on Win32 and WinCE and im trying to get it to work on Windows mobile 6.1 for use with Mc55 handheld devices.

    As far as im aware the code shouldnt have to be changed as it should work fine on the .net compact framework.

    It posts to a secure webservice.

    When i attempt to post i get the error "Could not establish trust relationship with remote server".

    From googling everyone says this is a problem with the SSL certificate of the webservice but it works fine on Win32 and WinCE 6.0 and i can browse to the webservice's wsdl definition on the device.

    The certificate is a wild card certificate but from what i can read online Windows Mobile 6.1 supports wildcard certificates and its for the correct hostname.

    Im Connecting through a work proxy server if that makes any difference but the other two machines are also working through the same proxy.

    Any suggestions on what it could be?


Comments

  • Registered Users Posts: 7,500 ✭✭✭BrokenArrows


    Found this on stackoverflow which seems to work but its actually forcing the client to accept the certificate.

    http://stackoverflow.com/questions/5713071/problem-ssl-certificate-c-sharp
    System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
    
    public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
    {
      public TrustAllCertificatePolicy() 
      {}
    
      public bool CheckValidationResult(ServicePoint sp, X509Certificate cert,WebRequest req, int problem)
      {
        return true;
      }
    }
    


Advertisement