Certificate issue with WCF client accessing webservice via broker



I am writing a client WCF webservice and have run into difficulty trying to
configure separate certificates for SSL and return message signature

I've included the web.config settings below for the website I am using for
testing the WCF client. The "clientCertificate" thumbprint links to my
private cert in my certificate store. The "defaultCertificate" is the SSL
cert thumbprint for the broker server, this certificate DNS matches the DNS
of the webservice URL I am hitting "fake.url.com" in my example (i've
replaced the actual url for security).

In this configuration I can trace the request and response and I do receive
a full and complete response with correct data however I receive the
following error from WCF:

"The incoming message was signed with a token which was different from what
used to encrypt the body. This was not expected."

If I replace the "defaultCertificate" thumbprint with the public cert used
to sign the response I get the following error because this certificate's DNS
does not match the broker server URL I am hitting. The certificate used to
sign the response has a non-URL name, for example "signing-cert". The error
I get is:

"Identity check failed for outgoing message. The expected DNS identity of
the remote endpoint was 'fake.url.com' but the remote endpoint provided DNS
claim 'signing-cert'. If this is a legitimate remote endpoint, you can fix
the problem by explicitly specifying DNS identity 'signing-cert' as the
Identity property of EndpointAddress when creating channel proxy."

I tried adding an identity property for the dns however it then returns the
following error:

"The HTTPS channel factory does not support explicit specification of an
identity in the EndpointAddress unless the authentication scheme is NTLM or
Parameter name: remoteAddress"

I seem to have run into a road-block here. I expect it should be a simple
matter to specify the certificate WCF should use to validate the SSL channel,
and to specify a separate certificate to validate the response message
signature. I seems that all examples I come across expect the same
certificate to be used for SSL channel as well as response signing.

I apreciate any advice/tips you may have...I've fairly new to WCF...Just
can't seem to find the right settings to get thins working 100%.

<binding name="AccountManagementSoapBindingImplSoapBinding">
<textMessageEncoding messageVersion="Soap11" writeEncoding="utf-8" />
<security allowSerializedSigningTokenOnReply="true"
defaultAlgorithmSuite="Default" authenticationMode="MutualCertificate"
requireDerivedKeys="false" includeTimestamp="true"
<httpsTransport authenticationScheme="Anonymous" />

<endpoint binding="customBinding" behaviorConfiguration="behavior"

<behavior name="behavior">
x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="My"/>
x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="My"/>
<authentication certificateValidationMode="PeerOrChainTrust"
trustedStoreLocation="LocalMachine" revocationMode="NoCheck"/>

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads