WCF error The client certificate is not provided. Specify a client certificate in ClientCredentials
Asked Answered
V

1

16

I am trying to call a WCF service .I created a selfsigned certificate and installed in my localmachine \personnal \certificates , and also I added that in my section .But I don't understand why this error is .

Here is my web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpEndpoint">
                    <security mode="Transport">
                        <transport clientCredentialType="Certificate" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://abcdxyz.abc.syntax.com/TestCCService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
                contract="TestCCService.ITestCCService" name="wsHttpEndpoint" />
        </client>

        <behaviors>
            <endpointBehaviors>
                <behavior name="CustomBehavior">
                    <clientCredentials>
                        <clientCertificate findValue="abc.mymachine.name.com" x509FindType="FindBySubjectName"
                          storeLocation="LocalMachine" storeName="My" />
                        </clientCredentials>
                </behavior>
            </endpointBehaviors>
        </behaviors>

    </system.serviceModel>
</configuration>

but when I try to call my service method its throwing errors "The client certificate is not provided. Specify a client certificate in ClientCredentials."

Appreciate your suggestions to resolve this error ?

Vermiform answered 27/3, 2013 at 1:33 Comment(2)
WCF is claiming that you have no client certificate that matches "abc.mymachine.name.com"; are you sure you created it correctly?Briney
Yes I have "abc.mymachine.name.com" certificate installed .Vermiform
V
17

I forgot to include behaviorConfiguration="CustomBehavior"

<endpoint address="https://abcdxyz.abc.syntax.com/TestCCService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
                contract="TestCCService.ITestCCService" name="wsHttpEndpoint" **behaviorConfiguration="CustomBehavior"** />

and its working now .

Thank you for help

Vermiform answered 27/3, 2013 at 16:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.