Hello team,
I am designing application in WPF and I want to connect wcf service through 2 way ssl authentication..
I have generated client-server certificate and pfx file.
I have import service certificate on IIS and client certificate on console root .
but still I am getting many error like
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.
this is my config at client side
="1.0"="utf-8"
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IBTA_Service">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://172.16.50.146:12466/BTA_Service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBTA_Service"
contract="BTA_Service.IBTA_Service" name="WSHttpBinding_IBTA_Service " behaviorConfiguration="EndpointBehavior" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint"
findValue="3a396124e4435f661d8b211ea5ae118c132f5b34"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Service level config is
="1.0"
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<connectionStrings>
<add name="GDS_Connection" connectionString="F5XGWMkZIKnvmeKRLmDIs85gfShEhVsCb31D96JcpdLpltZWV3RBdpfwwCVPeOPz5EcrGS0/6c2N/s3sV9TIiNokGMnzuptigq6kJQHbpAWo6G0mBWlIag=="/>
</connectionStrings>
<system.serviceModel>
<services>
<service name="BTA_WCF_Service.BTA_Service">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
contract="BTA_WCF_Service.IBTA_Service" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="Certificate"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<serviceCertificate storeLocation="LocalMachine" x509FindType="FindBySubjectDistinguishedName" storeName="My" findValue="localhost"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="True"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Please give me brief explaining and demo solution for the same..
What I have tried:
ERROR :-
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.
.
Please explain me entire process of 2 way ssl authentication