-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Header Expect 100-continue with client certificate #3185
Comments
I added a new feature (.NET Core only) for exactly this kind of scenario. We now allow modifying, replacing. or wrapping the HttpClientHandler. An example behavior which can be easily adapted to what you need can be found here. We turn on the Expect header by modifying var factory = new ChannelFactory<IService>(binding, endpointAddress);
var handlerFactoryBehavior = new HttpMessageHandlerBehavior();
handlerFactoryBehavior.OnSending = (message, token) =>
{
message.Headers.ExpectContinue = false;
return null;
};
factory.Endpoint.Behaviors.Add(handlerFactoryBehavior);
serviceProxy = factory.CreateChannel(); This should work as-is but you might want to streamline the implementation a bit as this has logic in it to allow providing a response message without actually sending the request at all. |
Hi, Thank you for your answer, it's working. I tried the same soap server with the .net framework 461 (net461). I have exactly the same code for the client except I didn't remove the header "Except 100-Continue" and it's working. So I'm wondering if there is a reason that the .net framework doesn't throw an exception when the server response 200 with the full response message while the .netcore implementation throw the exception :
|
It looks like you are hitting a different issue. HttpClientHandler in .NET Core 2.1 doesn't correctly implement Windows authentication with the Expect header. There's an issue tracking this at dotnet/corefx#30760. |
As your specific request (disable the 100-Continue header) has been answered and you are unblocked, I'm going to close this issue. We're tracking the Windows auth with Expect header problem in issue #2923. |
Hi everyone,
I'm using a SOAP Client within a dotnetcore projet. I have to use a client certificate but the problem is that the soap server doesn't support the header "Except 100-Continue".
I tried this old solution
System.Net.ServicePointManager.Expect100Continue = false;
but it doesn't seem to work..
I found an internal property, but it doesn't allow to be override (or I didn't find a way out) :
wcf/src/System.Private.ServiceModel/src/System/ServiceModel/Channels/HttpsChannelFactory.cs
Line 230 in 8589dae
I looked to add Interceptor or middleware, but I can't find something which allow me to remove the header.
Do you have any solution to remove this header ?
Thank you,
Vincent
The text was updated successfully, but these errors were encountered: