Skip to content

Commit

Permalink
.Net: Fix PlatformNotSupportedException from HttpClientProvider (#6323)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed May 18, 2024
1 parent e17e05a commit 915662c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dotnet/src/InternalUtilities/src/Http/HttpClientProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ private static SocketsHttpHandler CreateHandler()
#else
private static HttpClientHandler CreateHandler()
{
return new HttpClientHandler()
var handler = new HttpClientHandler();
try
{
// Check cert revocation
CheckCertificateRevocationList = true,
};
handler.CheckCertificateRevocationList = true;
}
catch (PlatformNotSupportedException) { } // not supported on older frameworks
return handler;
}
#endif
}
Expand Down

0 comments on commit 915662c

Please sign in to comment.