public async Task HttpClient_ClientUsesAuxRecord_Ok() { X509Certificate2 serverCert = Configuration.Certificates.GetServerCertificate(); var server = new HttpsTestServer(serverCert); server.StartServer(); int port = server.Port; string requestString = "https://localhost:" + port.ToString(); using (var handler = new HttpClientHandler() { ServerCertificateCustomValidationCallback = LoopbackServer.AllowAllCertificates }) using (var client = new HttpClient(handler)) { var tasks = new Task[2]; tasks[0] = server.RunTest(); tasks[1] = client.GetStringAsync(requestString); await Task.WhenAll(tasks).TimeoutAfter(15 * 1000); if (server.AuxRecordDetected) { _output.WriteLine("Test inconclusive: The Operating system preferred a non-CBC or Null cipher."); } else { Assert.True(server.AuxRecordDetected, "Server reports: Client auxiliary record not detected."); } } }
public async Task SslStream_ClientAndServerUsesAuxRecord_Ok() { X509Certificate2 serverCert = Configuration.Certificates.GetServerCertificate(); var server = new HttpsTestServer(serverCert); server.StartServer(); int port = server.Port; var client = new SchSendAuxRecordTestClient("localhost", port); var tasks = new Task[2]; tasks[0] = server.RunTest(); tasks[1] = client.RunTest(); await Task.WhenAll(tasks).TimeoutAfter(TestConfiguration.PassingTestTimeoutMilliseconds); if (server.IsAuxRecordDetectionInconclusive) { _output.WriteLine("Test inconclusive: The Operating system preferred a non-CBC or Null cipher."); } else { Assert.True(server.AuxRecordDetected, "Server reports: Client auxiliary record not detected."); Assert.True(client.AuxRecordDetected, "Client reports: Server auxiliary record not detected."); } }
public async Task SslStream_ClientAndServerUsesAuxRecord_Ok() { X509Certificate2 serverCert = Configuration.Certificates.GetServerCertificate(); var server = new HttpsTestServer(serverCert); server.StartServer(); int port = server.Port; var client = new SchSendAuxRecordTestClient("localhost", port); var tasks = new Task[2]; tasks[0] = server.RunTest(); tasks[1] = client.RunTest(); await Task.WhenAll(tasks).TimeoutAfter(TestConfiguration.PassingTestTimeoutMilliseconds); if (server.IsAuxRecordDetectionInconclusive) { _output.WriteLine("Test inconclusive: The Operating system preferred a non-CBC or Null cipher."); } else { Assert.True(server.AuxRecordDetected, "Server reports: Client auxiliary record not detected."); Assert.True(client.AuxRecordDetected, "Client reports: Server auxiliary record not detected."); } }