Skip to content

Commit b40b1bb

Browse files
author
John Luo
authored
Fix helix-matrix tests (#22918)
* Update SslProtocols to use system defaults
1 parent 4b8c0fc commit b40b1bb

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
621621
{
622622
using (var sslStream = new SslStream(connection.Stream, false, (sender, cert, chain, errors) => true, null))
623623
{
624-
await sslStream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.Tls12 | SslProtocols.Tls11, false);
624+
await sslStream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.None, false);
625625

626626
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
627627
await sslStream.WriteAsync(request, 0, request.Length);

src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void ConfigureListenOptions(ListenOptions listenOptions)
6868
Assert.True(tlsFeature.CipherStrength > 0, "CipherStrength");
6969
Assert.True(tlsFeature.HashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm"); // May be None on Linux.
7070
Assert.True(tlsFeature.HashStrength >= 0, "HashStrength"); // May be 0 for some algorithms
71-
Assert.True(tlsFeature.KeyExchangeAlgorithm > ExchangeAlgorithmType.None, "KeyExchangeAlgorithm");
71+
Assert.True(tlsFeature.KeyExchangeAlgorithm >= ExchangeAlgorithmType.None, "KeyExchangeAlgorithm"); // Maybe None on Windows 7
7272
Assert.True(tlsFeature.KeyExchangeStrength >= 0, "KeyExchangeStrength"); // May be 0 on mac
7373

7474
return context.Response.WriteAsync("hello world");

src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public async Task DoesNotThrowObjectDisposedExceptionOnConnectionAbort()
203203
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
204204
{
205205
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
206-
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
206+
enabledSslProtocols: SslProtocols.None,
207207
checkCertificateRevocation: false);
208208

209209
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
@@ -279,7 +279,7 @@ public async Task DoesNotThrowObjectDisposedExceptionOnEmptyConnection()
279279
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
280280
{
281281
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
282-
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
282+
enabledSslProtocols: SslProtocols.None,
283283
checkCertificateRevocation: false);
284284
}
285285
}

src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/InMemoryHttpClientSlim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private static async Task<Stream> GetStream(Stream rawStream, Uri requestUri, bo
124124
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
125125

126126
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
127-
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
127+
enabledSslProtocols: SslProtocols.None,
128128
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
129129
return sslStream;
130130
}

src/Testing/src/HttpClientSlim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static async Task<Stream> GetStream(Uri requestUri, bool validateCertifi
153153
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
154154

155155
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
156-
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
156+
enabledSslProtocols: SslProtocols.None,
157157
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
158158
return sslStream;
159159
}

0 commit comments

Comments
 (0)