Include IHttpClientCertificateFeature changes.
This commit is contained in:
parent
b89a64281f
commit
e7508af2d9
|
|
@ -308,11 +308,11 @@ namespace Microsoft.AspNet.Server.WebListener
|
||||||
set { _clientCert = value; }
|
set { _clientCert = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task<X509Certificate> IHttpClientCertificateFeature.GetClientCertificateAsync()
|
async Task<X509Certificate> IHttpClientCertificateFeature.GetClientCertificateAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (_clientCert == null)
|
if (_clientCert == null)
|
||||||
{
|
{
|
||||||
_clientCert = await Request.GetClientCertificateAsync();
|
_clientCert = await Request.GetClientCertificateAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
return _clientCert;
|
return _clientCert;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,9 @@ namespace Microsoft.Net.Server
|
||||||
// ERROR_NOT_FOUND - which means the client did not provide the cert
|
// ERROR_NOT_FOUND - which means the client did not provide the cert
|
||||||
// If this is important, the server should respond with 403 forbidden
|
// If this is important, the server should respond with 403 forbidden
|
||||||
// HTTP.SYS will not do this for you automatically
|
// HTTP.SYS will not do this for you automatically
|
||||||
internal Task LoadClientCertificateAsync()
|
internal Task LoadClientCertificateAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
// TODO: cancellation support? Abort the request?
|
||||||
uint size = CertBoblSize;
|
uint size = CertBoblSize;
|
||||||
bool retry;
|
bool retry;
|
||||||
do
|
do
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,7 @@ namespace Microsoft.Net.Server
|
||||||
// Populates the client certificate. The result may be null if there is no client cert.
|
// Populates the client certificate. The result may be null if there is no client cert.
|
||||||
// TODO: Does it make sense for this to be invoked multiple times (e.g. renegotiate)? Client and server code appear to
|
// TODO: Does it make sense for this to be invoked multiple times (e.g. renegotiate)? Client and server code appear to
|
||||||
// enable this, but it's unclear what Http.Sys would do.
|
// enable this, but it's unclear what Http.Sys would do.
|
||||||
public async Task<X509Certificate> GetClientCertificateAsync()
|
public async Task<X509Certificate> GetClientCertificateAsync(CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
if (SslStatus == SslStatus.Insecure)
|
if (SslStatus == SslStatus.Insecure)
|
||||||
{
|
{
|
||||||
|
|
@ -471,7 +471,7 @@ namespace Microsoft.Net.Server
|
||||||
ClientCertLoader certLoader = new ClientCertLoader(RequestContext);
|
ClientCertLoader certLoader = new ClientCertLoader(RequestContext);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await certLoader.LoadClientCertificateAsync().SupressContext();
|
await certLoader.LoadClientCertificateAsync(cancellationToken).SupressContext();
|
||||||
// Populate the environment.
|
// Populate the environment.
|
||||||
if (certLoader.ClientCert != null)
|
if (certLoader.ClientCert != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue