Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Wrap CurlHandler cert validation callback exceptions in HttpRequestException #21938

Merged
merged 2 commits into from
Jul 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/System.Net.Http/src/System/Net/Http/Unix/CurlException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ internal CurlException(int error, string message) : base(message)
HResult = error;
}

internal CurlException(int error, Exception innerException) : base(GetCurlErrorString(error, isMulti:false), innerException)
{
HResult = error;
}

internal CurlException(int error, bool isMulti) : this(error, GetCurlErrorString(error, isMulti))
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static int VerifyCertChain(IntPtr storeCtxPtr, IntPtr curlPtr)
catch (Exception exc)
{
EventSourceTrace("Unexpected exception: {0}", exc, easy: easy);
easy.FailRequest(exc);
easy.FailRequest(CreateHttpRequestException(new CurlException((int)CURLcode.CURLE_ABORTED_BY_CALLBACK, exc)));
return FailureResult;
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public async Task UseCallback_CallbackReturnsFailure_ThrowsException()
}
}

[ActiveIssue(21904)]
[OuterLoop] // TODO: Issue #11345
[Fact]
public async Task UseCallback_CallbackThrowsException_ExceptionPropagates()
Expand Down