Click here to Skip to main content
15,885,213 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys,

My WCF Service does not work. I received this message on 'ServiceModel Audit':

"Message authentication failed.
(...)
WebException:
The underlying connection was closed:
Could not establish trust relationship for the SSL/TLS secure channel. --->
AuthenticationException: The remote certificate is invalid according to the validation procedure."

**

I already use the line below in client project:

C#
//Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);


**
My cert is installed on root folder:

XML
<behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
		<serviceSecurityAudit auditLogLocation="Application" serviceAuthorizationAuditLevel="SuccessOrFailure"
         messageAuthenticationAuditLevel="SuccessOrFailure" />
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceCredentials>
            <serviceCertificate findValue="CertName" storeLocation="LocalMachine" storeName="Root" x509FindType="FindBySubjectName" />
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="ValidadeUser, MyNamespace" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
  </behaviors>


please people, help me!. Thanks a lot.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900