Fix helix-matrix tests (#22918)
* Update SslProtocols to use system defaults
This commit is contained in:
parent
4b8c0fcfcc
commit
b40b1bb7b2
|
|
@ -621,7 +621,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
{
|
{
|
||||||
using (var sslStream = new SslStream(connection.Stream, false, (sender, cert, chain, errors) => true, null))
|
using (var sslStream = new SslStream(connection.Stream, false, (sender, cert, chain, errors) => true, null))
|
||||||
{
|
{
|
||||||
await sslStream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.Tls12 | SslProtocols.Tls11, false);
|
await sslStream.AuthenticateAsClientAsync("localhost", new X509CertificateCollection(), SslProtocols.None, false);
|
||||||
|
|
||||||
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
|
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
|
||||||
await sslStream.WriteAsync(request, 0, request.Length);
|
await sslStream.WriteAsync(request, 0, request.Length);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
Assert.True(tlsFeature.CipherStrength > 0, "CipherStrength");
|
Assert.True(tlsFeature.CipherStrength > 0, "CipherStrength");
|
||||||
Assert.True(tlsFeature.HashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm"); // May be None on Linux.
|
Assert.True(tlsFeature.HashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm"); // May be None on Linux.
|
||||||
Assert.True(tlsFeature.HashStrength >= 0, "HashStrength"); // May be 0 for some algorithms
|
Assert.True(tlsFeature.HashStrength >= 0, "HashStrength"); // May be 0 for some algorithms
|
||||||
Assert.True(tlsFeature.KeyExchangeAlgorithm > ExchangeAlgorithmType.None, "KeyExchangeAlgorithm");
|
Assert.True(tlsFeature.KeyExchangeAlgorithm >= ExchangeAlgorithmType.None, "KeyExchangeAlgorithm"); // Maybe None on Windows 7
|
||||||
Assert.True(tlsFeature.KeyExchangeStrength >= 0, "KeyExchangeStrength"); // May be 0 on mac
|
Assert.True(tlsFeature.KeyExchangeStrength >= 0, "KeyExchangeStrength"); // May be 0 on mac
|
||||||
|
|
||||||
return context.Response.WriteAsync("hello world");
|
return context.Response.WriteAsync("hello world");
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
|
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
|
||||||
{
|
{
|
||||||
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
|
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
|
||||||
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
|
enabledSslProtocols: SslProtocols.None,
|
||||||
checkCertificateRevocation: false);
|
checkCertificateRevocation: false);
|
||||||
|
|
||||||
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
|
var request = Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost:\r\n\r\n");
|
||||||
|
|
@ -279,7 +279,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
|
using (var sslStream = new SslStream(connection.Stream, true, (sender, certificate, chain, errors) => true))
|
||||||
{
|
{
|
||||||
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
|
await sslStream.AuthenticateAsClientAsync("127.0.0.1", clientCertificates: null,
|
||||||
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
|
enabledSslProtocols: SslProtocols.None,
|
||||||
checkCertificateRevocation: false);
|
checkCertificateRevocation: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.TestTrans
|
||||||
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
|
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
|
||||||
|
|
||||||
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
|
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
|
||||||
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
|
enabledSslProtocols: SslProtocols.None,
|
||||||
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
|
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
|
||||||
return sslStream;
|
return sslStream;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ namespace Microsoft.AspNetCore.Testing
|
||||||
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
|
validateCertificate ? null : (RemoteCertificateValidationCallback)((a, b, c, d) => true));
|
||||||
|
|
||||||
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
|
await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
|
||||||
enabledSslProtocols: SslProtocols.Tls11 | SslProtocols.Tls12,
|
enabledSslProtocols: SslProtocols.None,
|
||||||
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
|
checkCertificateRevocation: validateCertificate).ConfigureAwait(false);
|
||||||
return sslStream;
|
return sslStream;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue