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