Skip to content
Merged
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
Fix WebSockets.Client.ConnectTest crash for apple mobile platforms
#74473 had a change where we started adding a client certificate that is not supported on apple mobile platforms. This lead to an unhandled exception in the MemberData setup of ConnectAsync_CustomInvokerWithIncompatibleWebSocketOptions_ThrowsArgumentException and resulted in an app crash.

Addresses #75307
  • Loading branch information
Steve Pfister committed Sep 9, 2022
commit 48dd36780f7826b4a8ef4d1b1ede060a82b3cf64
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ public static IEnumerable<object[]> ConnectAsync_CustomInvokerWithIncompatibleWe
yield return NoThrow(options => options.UseDefaultCredentials = false);
yield return Throw(options => options.Credentials = new NetworkCredential());
yield return Throw(options => options.Proxy = new WebProxy());
yield return Throw(options => options.ClientCertificates.Add(Test.Common.Configuration.Certificates.GetClientCertificate()));

// Will result in an exception on apple mobile platforms
// and crash the test.
if (PlatformDetection.IsNotAppleMobile)
{
yield return Throw(options => options.ClientCertificates.Add(Test.Common.Configuration.Certificates.GetClientCertificate()));
}

yield return NoThrow(options => options.ClientCertificates = new X509CertificateCollection());
yield return Throw(options => options.RemoteCertificateValidationCallback = delegate { return true; });
yield return Throw(options => options.Cookies = new CookieContainer());
Expand Down