locked
Could not establish trust relationship for the SSL/TLS secure channel with authority

    Question

  • Hello everyone, I need to establish a connection between my HTTPS WCF hosted in Windows Azure Web Role and my Windows Store App Client. The service is actually exposed for testing purposes using a self-signed certificate.

    I have installed the certificate in Personal and Trusted Root Certification Authorities in Current User and Local Manchine.

    In the Windows Store App, I create the service reference pointing to the cloud https service, then edit the manifest and create a new declaration to Add a New Certificate, I checked Exclusive Trust and Auto select, pointing to Root storage name and my self-signed certificate.cer.

    The result is the following exception in the IntelliTrace stack:

    Exception:Caught: "The remote certificate is invalid according to the validation procedure." (System.Security.Authentication.AuthenticationException)
    A System.Security.Authentication.AuthenticationException was caught: "The remote certificate is invalid according to the validation procedure."
    Time: 19/01/2015 04:42:33 p. m.
    Thread:Worker Thread[17080]

    Exception:Thrown: "Could not establish trust relationship for the SSL/TLS secure channel with authority 'appchallengewhi.cloudapp.net'." (System.ServiceModel.Security.SecurityNegotiationException)
    A System.ServiceModel.Security.SecurityNegotiationException was thrown: "Could not establish trust relationship for the SSL/TLS secure channel with authority 'appchallengewhi.cloudapp.net'."
    Time: 19/01/2015 04:42:34 p. m.
    Thread:Worker Thread[17080]

    Appreciate any help, to solve this with the approach of WCF Service Reference in Windows Store App.

    Note:
    If I call the HTTPS service using a Console App it works very good using the following the code:

    ChannelFactory<IAgentService> factory = new ChannelFactory<IAgentService>("basicHttpBinding_IAgentService");
    ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true;
    IAgentService wcfProxy = factory.CreateChannel();

    Thanks in advance,
    RC


    • Edited by rcervantes1 Monday, January 19, 2015 10:59 PM
    Monday, January 19, 2015 10:49 PM