Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SSl Problem on windows mobile with C#

  • 20-03-2013 02:35PM
    #1
    Registered Users, Registered Users 2 Posts: 7,544 ✭✭✭


    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, Registered Users 2 Posts: 7,544 ✭✭✭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