File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,18 @@ async Task<X509Certificate2> ITlsConnectionFeature.GetClientCertificateAsync(Can
333
333
{
334
334
if ( IsNotInitialized ( Fields . ClientCertificate ) )
335
335
{
336
- _clientCert = await Request . GetClientCertificateAsync ( cancellationToken ) ;
336
+ var method = _requestContext . Server . Options . ClientCertificateMethod ;
337
+ if ( method != ClientCertificateMethod . NoCertificate )
338
+ {
339
+ // Check if a cert was already available on the connection.
340
+ _clientCert = Request . ClientCertificate ;
341
+ }
342
+
343
+ if ( _clientCert == null && method == ClientCertificateMethod . AllowRenegotation )
344
+ {
345
+ _clientCert = await Request . GetClientCertificateAsync ( cancellationToken ) ;
346
+ }
347
+
337
348
SetInitialized ( Fields . ClientCertificate ) ;
338
349
}
339
350
return _clientCert ;
Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ public string RequestQueueName
55
55
public RequestQueueMode RequestQueueMode { get ; set ; }
56
56
57
57
/// <summary>
58
- /// Indicates how client certificates should be populated. The default is to allow renegotation .
58
+ /// Indicates how client certificates should be populated. The default is to allow a certificate without renegotiation .
59
59
/// This does not change the netsh 'clientcertnegotiation' binding option which will need to be enabled for
60
60
/// ClientCertificateMethod.AllowCertificate to resolve a certificate.
61
61
/// </summary>
62
- public ClientCertificateMethod ClientCertificateMethod { get ; set ; } = ClientCertificateMethod . AllowRenegotation ;
62
+ public ClientCertificateMethod ClientCertificateMethod { get ; set ; } = ClientCertificateMethod . AllowCertificate ;
63
63
64
64
/// <summary>
65
65
/// The maximum number of concurrent accepts.
You can’t perform that action at this time.
0 commit comments