Skip to content

Ignore revocation checking failures on HTTPS tests on OSX #116910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 30, 2025
Merged
Changes from 3 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 @@ -256,6 +256,7 @@ public async Task NoCallback_RevokedCertificate_RevocationChecking_Fails()
{
new object[] { Configuration.Http.ExpiredCertRemoteServer, SslPolicyErrors.RemoteCertificateChainErrors },
new object[] { Configuration.Http.WrongHostNameCertRemoteServer , SslPolicyErrors.RemoteCertificateNameMismatch},
new object[] { "https://smartermail.emclient.com/", SslPolicyErrors.None},
};

private async Task UseCallback_BadCertificate_ExpectedPolicyErrors_Helper(string url, string useHttp2String, SslPolicyErrors expectedErrors)
Expand All @@ -267,6 +268,15 @@ private async Task UseCallback_BadCertificate_ExpectedPolicyErrors_Helper(string

handler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) =>
{
// https://github.com/dotnet/corefx/issues/21922#issuecomment-315555237
X509ChainStatusFlags flags = chain.ChainStatus.Aggregate(X509ChainStatusFlags.NoError, (cur, status) => cur | status.Status);
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) &&
flags == X509ChainStatusFlags.RevocationStatusUnknown &&
handler.CheckCertificateRevocationList)
{
expectedErrors |= SslPolicyErrors.RemoteCertificateChainErrors;
}

callbackCalled = true;
Assert.NotNull(request);
Assert.NotNull(cert);
Expand Down
Loading