Include IHttpClientCertificateFeature changes.

This commit is contained in:
Chris Ross 2014-06-26 10:16:57 -07:00
Родитель b89a64281f
Коммит e7508af2d9
3 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -308,11 +308,11 @@ namespace Microsoft.AspNet.Server.WebListener
set { _clientCert = value; }
}
async Task<X509Certificate> IHttpClientCertificateFeature.GetClientCertificateAsync()
async Task<X509Certificate> IHttpClientCertificateFeature.GetClientCertificateAsync(CancellationToken cancellationToken)
{
if (_clientCert == null)
{
_clientCert = await Request.GetClientCertificateAsync();
_clientCert = await Request.GetClientCertificateAsync(cancellationToken);
}
return _clientCert;
}

Просмотреть файл

@ -162,8 +162,9 @@ namespace Microsoft.Net.Server
// ERROR_NOT_FOUND - which means the client did not provide the cert
// If this is important, the server should respond with 403 forbidden
// 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;
bool retry;
do

Просмотреть файл

@ -455,7 +455,7 @@ namespace Microsoft.Net.Server
// 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
// 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)
{
@ -471,7 +471,7 @@ namespace Microsoft.Net.Server
ClientCertLoader certLoader = new ClientCertLoader(RequestContext);
try
{
await certLoader.LoadClientCertificateAsync().SupressContext();
await certLoader.LoadClientCertificateAsync(cancellationToken).SupressContext();
// Populate the environment.
if (certLoader.ClientCert != null)
{