From d3ac7dff0159f7e92c8bc531c6c9db2ef51723a1 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 24 May 2022 17:36:14 +0200 Subject: [PATCH] fix: use delay client certificate mode --- sample/Aguacongas.TheIdServer.MtlsSample/Program.cs | 2 +- src/Aguacongas.TheIdServer.Shared/Program.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sample/Aguacongas.TheIdServer.MtlsSample/Program.cs b/sample/Aguacongas.TheIdServer.MtlsSample/Program.cs index c57c1e4fa..577ad6da7 100644 --- a/sample/Aguacongas.TheIdServer.MtlsSample/Program.cs +++ b/sample/Aguacongas.TheIdServer.MtlsSample/Program.cs @@ -27,7 +27,7 @@ async Task RequestTokenAsync() if (response.IsError) { - throw new Exception(response.Error); + throw response.Exception ?? new InvalidOperationException(response.Error); } return response; diff --git a/src/Aguacongas.TheIdServer.Shared/Program.cs b/src/Aguacongas.TheIdServer.Shared/Program.cs index e6d00e31a..eeea33bf9 100644 --- a/src/Aguacongas.TheIdServer.Shared/Program.cs +++ b/src/Aguacongas.TheIdServer.Shared/Program.cs @@ -38,7 +38,7 @@ // when mutual TLS is enable the web host must receive client certificate builder.WebHost.ConfigureKestrel(kestrel => { - kestrel.ConfigureHttpsDefaults(https => https.ClientCertificateMode = ClientCertificateMode.AllowCertificate); + kestrel.ConfigureHttpsDefaults(https => https.ClientCertificateMode = ClientCertificateMode.DelayCertificate); }); } @@ -60,5 +60,4 @@ }); app.UseTheIdServer(app.Environment, configuration); - app.Run();