I have a self-hosted WCF REST service based on the WebHttpBinding. One of the methods on the service looks something like this:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "myMethod")]
Stream MyMethod(Stream contents);
I wrote a simple test program that creates a HttpWebRequest to try and POST data to this method. This works fine in the following scenarios:
- Service is not using any security.
- Service is using transport security without client certificate.
- Service is using transport security with client certificate and I POST 0 bytes.
If I try to use transport security with a client certificate a POST more than 0 bytes, the service returns HTTP 403 (forbidden), and it never hits any of my code.
This is driving me nuts.
Any ideas?
UPDATE
After enabling tracing for http.sys, I observed the following message in the trace:
Attempt by server application to receive client certificate failed with status: 0xC0000225.
Does anyone know what this means? I'm certain that I'm sending the client certificate and certain that it's trusted by the host machine.