Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ private async ValueTask<SslStream> EstablishSslConnection(string host, HttpReque
{
callback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) =>
{
return _settings._serverCertificateCustomValidationCallback(request, certificate as X509Certificate2, chain, sslPolicyErrors);
try
{
return _settings._serverCertificateCustomValidationCallback(request, certificate as X509Certificate2, chain, sslPolicyErrors);
}
catch (Exception e)
{
throw new HttpRequestException(SR.net_http_ssl_connection_failed, e);
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ public async Task UseCallback_CallbackReturnsFailure_ThrowsException()
[ConditionalFact(nameof(BackendSupportsCustomCertificateHandling))]
public async Task UseCallback_CallbackThrowsException_ExceptionPropagatesAsBaseException()
{
if (ManagedHandlerTestHelpers.IsEnabled)
{
return; // TODO #21904: ManagedHandler is not properly wrapping exception.
}

if (BackendDoesNotSupportCustomCertificateHandling) // can't use [Conditional*] right now as it's evaluated at the wrong time for the managed handler
{
Console.WriteLine($"Skipping {nameof(UseCallback_CallbackThrowsException_ExceptionPropagatesAsBaseException)}()");
Expand Down