diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs index 047bf5c87d5f5..38149dbcc92dc 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs @@ -163,7 +163,7 @@ internal void UpdateOptions(SslServerAuthenticationOptions sslServerAuthenticati if (certificateWithKey != null && certificateWithKey.HasPrivateKey) { // given cert is X509Certificate2 with key. We can use it directly. - CertificateContext = SslStreamCertificateContext.Create(certificateWithKey, null); + CertificateContext = SslStreamCertificateContext.Create(certificateWithKey, additionalCertificates: null, offline: false, trust: null, noOcspFetch: true); } else { diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs index c77eece753e1f..eb6b6aad29972 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs @@ -123,16 +123,9 @@ public Task ConnectWithRevocation_StapledOcsp(bool offlineContext, bool noInterm [Fact] [PlatformSpecific(TestPlatforms.Linux)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/70981", typeof(PlatformDetection), nameof(PlatformDetection.IsDebian10))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/70981", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public Task ConnectWithRevocation_ServerCertWithoutContext_NoStapledOcsp() { - // Offline will only work if - // a) the revocation has been checked recently enough that it is cached, or - // b) the server stapled the response - // - // At high load, the server's background fetch might not have completed before - // this test runs. + // When using specific certificate, OCSP is disabled e.g. when SslStreamCertificateContext is passed in explicitly. return ConnectWithRevocation_WithCallback_Core(X509RevocationMode.Offline, offlineContext: null); }