108 references to ClientCertificateMode
Aspire.Dashboard (3)
DashboardWebApplication.cs (3)
526values[$"Kestrel:Endpoints:{endpointName}:ClientCertificateMode"] = ClientCertificateMode.RequireCertificate.ToString(); 575if (endpointConfiguration.HttpsOptions.ClientCertificateMode == ClientCertificateMode.RequireCertificate) 607if (endpointConfiguration.HttpsOptions.ClientCertificateMode == ClientCertificateMode.RequireCertificate)
Certificate.Sample (1)
Program.cs (1)
24opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
InMemory.FunctionalTests (27)
HttpsConnectionMiddlewareTests.cs (22)
213ClientCertificateMode = ClientCertificateMode.RequireCertificate 230ClientCertificateMode = ClientCertificateMode.AllowCertificate 509options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 545options.ClientCertificateMode = ClientCertificateMode.NoCertificate; 589options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 630options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 763options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 887options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 1024options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 1071options.ClientCertificateMode = ClientCertificateMode.DelayCertificate; 1140options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1162[InlineData(ClientCertificateMode.AllowCertificate)] 1163[InlineData(ClientCertificateMode.RequireCertificate)] 1164public async Task ClientCertificateValidationGetsCalledWithNotNullParameters(ClientCertificateMode mode) 1196[InlineData(ClientCertificateMode.AllowCertificate)] 1197[InlineData(ClientCertificateMode.RequireCertificate)] 1198public async Task ValidationFailureRejectsConnection(ClientCertificateMode mode) 1222[InlineData(ClientCertificateMode.AllowCertificate)] 1223[InlineData(ClientCertificateMode.RequireCertificate)] 1224public async Task RejectsConnectionOnSslPolicyErrorsWhenNoValidation(ClientCertificateMode mode) 1254options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1279options.ClientCertificateMode = ClientCertificateMode.RequireCertificate;
HttpsTests.cs (4)
115options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 123Assert.Equal(ClientCertificateMode.RequireCertificate, opt.ClientCertificateMode); 147options.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 156Assert.Equal(ClientCertificateMode.RequireCertificate, opt.ClientCertificateMode);
KestrelMetricsTests.cs (1)
864options.ClientCertificateMode = Https.ClientCertificateMode.RequireCertificate;
Interop.FunctionalTests (14)
Http3\Http3TlsTests.cs (12)
73[InlineData(ClientCertificateMode.RequireCertificate)] 74[InlineData(ClientCertificateMode.AllowCertificate)] 78public async Task ClientCertificate_AllowOrRequire_Available_Accepted(ClientCertificateMode mode) 117[InlineData(ClientCertificateMode.NoCertificate)] 118[InlineData(ClientCertificateMode.DelayCertificate)] 120public async Task ClientCertificate_NoOrDelayed_Available_Ignored(ClientCertificateMode mode) 159[InlineData(ClientCertificateMode.RequireCertificate, false)] 160[InlineData(ClientCertificateMode.RequireCertificate, true)] 161[InlineData(ClientCertificateMode.AllowCertificate, false)] 162[InlineData(ClientCertificateMode.AllowCertificate, true)] 165public async Task ClientCertificate_AllowOrRequire_Available_Invalid_Refused(ClientCertificateMode mode, bool serverAllowInvalid) 233httpsOptions.ClientCertificateMode = ClientCertificateMode.AllowCertificate;
HttpClientHttp2InteropTests.cs (2)
1612httpsOptions.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1657httpsOptions.ClientCertificateMode = ClientCertificateMode.DelayCertificate;
Kestrel.SampleApp (1)
Startup.cs (1)
94httpsOptions.ClientCertificateMode = ClientCertificateMode.DelayCertificate;
Microsoft.AspNetCore.Server.Kestrel.Core (31)
HttpsConnectionAdapterOptions.cs (3)
26ClientCertificateMode = ClientCertificateMode.NoCertificate; 64/// Specifies the client certificate requirements for a HTTPS connection. Defaults to <see cref="ClientCertificateMode.NoCertificate"/>. 66public ClientCertificateMode ClientCertificateMode { get; set; }
Internal\ConfigurationReader.cs (12)
166private static ClientCertificateMode? ParseClientCertificateMode(string? clientCertificateMode) 168if (Enum.TryParse<ClientCertificateMode>(clientCertificateMode, ignoreCase: true, out var result)) 244public ClientCertificateMode? ClientCertificateMode { get; set; } 299public ClientCertificateMode? ClientCertificateMode { get; set; } 308(ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate) == (other.ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate) && 314Certificate, ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate, Sni.Count, _configSectionClone); 343public ClientCertificateMode? ClientCertificateMode { get; set; } 350(ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate) == (other.ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate); 354Certificate, ClientCertificateMode ?? Https.ClientCertificateMode.NoCertificate);
Internal\SniOptionsSelector.cs (8)
83var clientCertificateMode = sniConfig.ClientCertificateMode ?? fallbackHttpsOptions.ClientCertificateMode; 85if (clientCertificateMode != ClientCertificateMode.NoCertificate) 87sslOptions.ClientCertificateRequired = clientCertificateMode == ClientCertificateMode.AllowCertificate 88|| clientCertificateMode == ClientCertificateMode.RequireCertificate; 116public (SslServerAuthenticationOptions, ClientCertificateMode) GetOptions(ConnectionContext connection, string serverName) 183callbackContext.AllowDelayedClientCertificateNegotation = clientCertificateMode == ClientCertificateMode.DelayCertificate; 207public SniOptions(SslServerAuthenticationOptions sslOptions, HttpProtocols httpProtocols, ClientCertificateMode clientCertificateMode) 216public ClientCertificateMode ClientCertificateMode { get; }
Middleware\HttpsConnectionMiddleware.cs (8)
111var remoteCertificateValidationCallback = _options.ClientCertificateMode == ClientCertificateMode.NoCertificate ? 150_options?.ClientCertificateMode == ClientCertificateMode.DelayCertificate; 341ClientCertificateRequired = _options.ClientCertificateMode == ClientCertificateMode.AllowCertificate 342|| _options.ClientCertificateMode == ClientCertificateMode.RequireCertificate, 376ClientCertificateMode clientCertificateMode, 384return clientCertificateMode != ClientCertificateMode.RequireCertificate; 566if (httpsOptions.ClientCertificateMode == ClientCertificateMode.AllowCertificate 567|| httpsOptions.ClientCertificateMode == ClientCertificateMode.RequireCertificate)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (5)
SniOptionsSelectorTests.cs (5)
743ClientCertificateMode = ClientCertificateMode.DelayCertificate, 755ClientCertificateMode = ClientCertificateMode.AllowCertificate 762Assert.Equal(ClientCertificateMode.DelayCertificate, certMode); 790ClientCertificateMode = ClientCertificateMode.AllowCertificate 797Assert.Equal(ClientCertificateMode.AllowCertificate, certMode);
Microsoft.AspNetCore.Server.Kestrel.Tests (26)
ConfigurationReaderTests.cs (5)
187Assert.Equal(ClientCertificateMode.AllowCertificate, end2.ClientCertificateMode); 195Assert.Equal(ClientCertificateMode.RequireCertificate, end3.ClientCertificateMode); 208Assert.Equal(ClientCertificateMode.NoCertificate, end4.ClientCertificateMode); 336Assert.Equal(ClientCertificateMode.AllowCertificate, config.ClientCertificateMode); 390Assert.Equal(ClientCertificateMode.AllowCertificate, endpoint.ClientCertificateMode);
KestrelConfigurationLoaderTests.cs (21)
165opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 182Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode); 211opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 225Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode); 790new KeyValuePair<string, string>("Endpoints:End1:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), 823new KeyValuePair<string, string>("EndpointDefaults:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), 1058opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1074Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode); 1128opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1144Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode); 1316Assert.Equal(ClientCertificateMode.NoCertificate, opt.ClientCertificateMode); 1330Assert.Equal(ClientCertificateMode.AllowCertificate, opt.HttpsOptions.ClientCertificateMode); 1339Assert.Equal(ClientCertificateMode.NoCertificate, httpsOptions.ClientCertificateMode); 1361new KeyValuePair<string, string>("Endpoints:End1:Sni:*.example.org:ClientCertificateMode", ClientCertificateMode.RequireCertificate.ToString()), 1373Assert.Equal(ClientCertificateMode.RequireCertificate, sniConfig.ClientCertificateMode); 1386opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1398Assert.Equal(ClientCertificateMode.AllowCertificate, opt.HttpsOptions.ClientCertificateMode); 1425Assert.Equal(ClientCertificateMode.AllowCertificate, opt.HttpsOptions.ClientCertificateMode); 1442Assert.Equal(ClientCertificateMode.AllowCertificate, opt.ClientCertificateMode); 1443opt.ClientCertificateMode = ClientCertificateMode.RequireCertificate; 1455Assert.Equal(ClientCertificateMode.RequireCertificate, opt.HttpsOptions.ClientCertificateMode);