Skip to content
Open
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
16 changes: 16 additions & 0 deletions src/Docfx.Build/XRefMaps/XRefMapDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System.IO.Compression;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Docfx.Common;

using EnvironmentVariables = Docfx.DataContracts.Common.Constants.EnvironmentVariables;
Expand Down Expand Up @@ -158,6 +160,20 @@ private static async Task<XRefMap> DownloadFromWebAsync(Uri uri, CancellationTok
{
AutomaticDecompression = DecompressionMethods.All,
CheckCertificateRevocationList = !EnvironmentVariables.NoCheckCertificateRevocationList,
ServerCertificateCustomValidationCallback = (req, cert, chain, errors) =>
{
if (errors == SslPolicyErrors.None)
return true;

// Ignore OCSP validation error on macos. (On GitHub Actions environment. OSCP HTTP access seems be blocked)
if (OperatingSystem.IsMacOS())
{
if (chain?.ChainStatus != null && chain.ChainStatus.All(s => s.Status == X509ChainStatusFlags.RevocationStatusUnknown))
return true;
}

return false;
}
})
{
Timeout = TimeSpan.FromMinutes(30), // Default: 100 seconds
Expand Down
1 change: 0 additions & 1 deletion test/Docfx.Dotnet.Tests/SymbolUrlResolverUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Xunit;

namespace Docfx.Dotnet.Tests;
Expand Down
Loading