First time using WCF and have a web application that consumes a web service that uses certificates as the method for authentication.
As far as certficates go, I have 3 available for use in the application. Part of my issue may be that I am not using them correctly in the Service Model settings within the configuration file.
1. SignedByCA: a client certificate in the local machine personal store that was signed by the service publisher.
2. PublicCert: from the https location of the WSDL defining the service (to establish trust relationship). Installed on local mahine in both personal and trusted cert store.
3. ServiceCA: from the service host installed in the local machine trusted cert store.
Below are the settings I have enabled in the config file for the ServiceModel. I have tried to change settings in an effort to get this working but am just not sure if their correct. I want to make sure everything is set up correctly on my end before informing the service provider that there may be an issue on their end.
At this time, I receive the following error when attempting to access with these settings:
{"The remote server returned an unexpected response: (400) Bad Request."}
If anyone can review my service model settings, given the information provided above, it would be greatly appreciated.
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="myserviceSOAP">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Certificate" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address=" behaviorConfiguration="ClientCert" binding="wsHttpBinding" bindingConfiguration="myserviceSOAP" contract="ServiceReferenceInfoHere" name="myserviceSOAP">
<identity>
<certificateReference storeLocation="LocalMachine" storeName="My"
x509FindType="FindBySubjectName" findValue="PublicCert" />
</identity>
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="ClientCert">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine" storeName="My" findValue="SignedByCA" x509FindType="FindBySubjectName"/>
<serviceCertificate>
<authentication certificateValidationMode="PeerOrChainTrust"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
Thanks in advance
As far as certficates go, I have 3 available for use in the application. Part of my issue may be that I am not using them correctly in the Service Model settings within the configuration file.
1. SignedByCA: a client certificate in the local machine personal store that was signed by the service publisher.
2. PublicCert: from the https location of the WSDL defining the service (to establish trust relationship). Installed on local mahine in both personal and trusted cert store.
3. ServiceCA: from the service host installed in the local machine trusted cert store.
Below are the settings I have enabled in the config file for the ServiceModel. I have tried to change settings in an effort to get this working but am just not sure if their correct. I want to make sure everything is set up correctly on my end before informing the service provider that there may be an issue on their end.
At this time, I receive the following error when attempting to access with these settings:
{"The remote server returned an unexpected response: (400) Bad Request."}
If anyone can review my service model settings, given the information provided above, it would be greatly appreciated.
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="myserviceSOAP">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Certificate" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address=" behaviorConfiguration="ClientCert" binding="wsHttpBinding" bindingConfiguration="myserviceSOAP" contract="ServiceReferenceInfoHere" name="myserviceSOAP">
<identity>
<certificateReference storeLocation="LocalMachine" storeName="My"
x509FindType="FindBySubjectName" findValue="PublicCert" />
</identity>
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="ClientCert">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine" storeName="My" findValue="SignedByCA" x509FindType="FindBySubjectName"/>
<serviceCertificate>
<authentication certificateValidationMode="PeerOrChainTrust"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
Thanks in advance