Use SslApplicationProtocol.Http3 (#36702)

* Use SslApplicationProtocol.Http3

Use the new SslApplicationProtocol.Http3 field where relevant.
Addresses #36668.

* Assert ConfirmEmailAsync() is successful

Assert that the email is confirmed successfully before continuing the test.
This commit is contained in:
Martin Costello 2021-09-18 23:47:14 +01:00 коммит произвёл GitHub
Родитель 2347f90c73
Коммит db4dc17779
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -1646,7 +1646,7 @@ namespace Microsoft.AspNetCore.Identity.Test
var email = await manager.GetUserNameAsync(user) + "@diddly.bop";
IdentityResultAssert.IsSuccess(await manager.SetEmailAsync(user, email));
var token = await manager.GenerateEmailConfirmationTokenAsync(user);
await manager.ConfirmEmailAsync(user, token);
IdentityResultAssert.IsSuccess(await manager.ConfirmEmailAsync(user, token));
var stamp = await manager.GetSecurityStampAsync(user);
Assert.NotNull(stamp);
@ -1823,7 +1823,7 @@ namespace Microsoft.AspNetCore.Identity.Test
Assert.Equal("Phone", factors[0]);
IdentityResultAssert.IsSuccess(await manager.SetEmailAsync(user, "test@test.com"));
token = await manager.GenerateEmailConfirmationTokenAsync(user);
await manager.ConfirmEmailAsync(user, token);
IdentityResultAssert.IsSuccess(await manager.ConfirmEmailAsync(user, token));
factors = await manager.GetValidTwoFactorProvidersAsync(user);
Assert.NotNull(factors);
Assert.Equal(2, factors.Count);

Просмотреть файл

@ -519,7 +519,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
var sslServerAuthenticationOptions = new SslServerAuthenticationOptions
{
ServerCertificate = httpsOptions.ServerCertificate,
ApplicationProtocols = new List<SslApplicationProtocol>() { new SslApplicationProtocol("h3"), new SslApplicationProtocol("h3-29") },
ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http3, new SslApplicationProtocol("h3-29") },
CertificateRevocationCheckMode = httpsOptions.CheckCertificateRevocation ? X509RevocationMode.Online : X509RevocationMode.NoCheck,
};

Просмотреть файл

@ -25,7 +25,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests
{
internal static class QuicTestHelpers
{
public const string Alpn = "h3";
private static readonly byte[] TestData = Encoding.UTF8.GetBytes("Hello world");
public static QuicTransportFactory CreateTransportFactory(ILoggerFactory loggerFactory = null, ISystemClock systemClock = null)
@ -58,7 +57,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests
var cert = TestResources.GetTestCertificate();
var sslServerAuthenticationOptions = new SslServerAuthenticationOptions();
sslServerAuthenticationOptions.ApplicationProtocols = new List<SslApplicationProtocol>() { new SslApplicationProtocol(Alpn) };
sslServerAuthenticationOptions.ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http3 };
sslServerAuthenticationOptions.ServerCertificate = cert;
sslServerAuthenticationOptions.RemoteCertificateValidationCallback = RemoteCertificateValidationCallback;
sslServerAuthenticationOptions.ClientCertificateRequired = clientCertificateRequired;
@ -99,7 +98,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests
{
ApplicationProtocols = new List<SslApplicationProtocol>
{
new SslApplicationProtocol(Alpn)
SslApplicationProtocol.Http3
},
RemoteCertificateValidationCallback = RemoteCertificateValidationCallback
}