dotnet / dotnet/wcf

Not mapping to correct expected exception .

Open
#3,112 0 comments 0 reactions 0 assignees View on GitHub
Backlog bug UWP
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

Test case expecting a SecurityNegotiationException is failing because we are instead getting a CommunicationException.

Investigate and determine if the exception we are getting is sufficient for us to correctly map to a SecurityNegotiationException.

Test Case: HttpsTests.Https_SecModeTrans_CertValMode_PeerTrust_Fails_Not_In_TrustedPeople

Failing on target framework uap and uapaot.

Call Stack...

```
Expected SecurityNegotiationException but received System.ServiceModel.CommunicationException: An error occurred while sending the request.
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.Exception: A security problem occurred.\r\n\r\nA security problem occurred.\r\n\r\n

at System.Net.Http.HttpHandlerToFilter.SendAsync(HttpRequestMessage request, CancellationToken cancel) in E:\\A\\_work\\2\\s\\corefx\\src\\System.Net.Http\\src\\uap\\System\\Net\\HttpHandlerToFilter.cs:line 90\r\n
at System.Net.Http.HttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\\A\\_work\\2\\s\\corefx\\src\\System.Net.Http\\src\\uap\\System\\Net\\HttpClientHandler.cs:line 607\r\n

--- End of inner exception stack trace ---\r\n
at System.Net.Http.HttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\\A\\_work\\2\\s\\corefx\\src\\System.Net.Http\\src\\uap\\System\\Net\\HttpClientHandler.cs:line 616\r\n
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in E:\\A\\_work\\2\\s\\corefx\\src\\System.Net.Http\\src\\System\\Net\\Http\\HttpClient.cs:line 511\r\n
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.SendRequestAsync(Message message, TimeoutHelper timeoutHelper)\r\n

--- End of inner exception stack trace ---\r\n
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(HttpRequestException requestException, HttpRequestMessage request, HttpAbortReason abortReason)\r\n
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.SendRequestAsync(Message message, TimeoutHelper timeoutHelper)\r\n
at System.ServiceModel.Channels.RequestChannel.RequestAsync(Message message, TimeSpan timeout)\r\n
at System.ServiceModel.Channels.RequestChannel.RequestAsyncInternal(Message message, TimeSpan timeout)\r\n
at System.Runtime.TaskHelpers.WaitForCompletionNoSpin[TResult](Task`1 task)\r\n
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)\r\n
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)\r\n
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)\r\n
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)\r\n

--- End of stack trace from previous location where exception was thrown ---\r\n at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args) in E:\\A\\_work\\2\\s\\corefx\\src\\System.Reflection.DispatchProxy\\src\\System\\Reflection\\DispatchProxyGenerator.cs:line 162\r\n
at generatedProxy_1.Echo(String )\r\n at HttpsTests.Https_SecModeTrans_CertValMode_PeerTrust_Fails_Not_In_TrustedPeople()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.