Android HttpClientHandler.ClientCertificates fix (#2270)
This commit is contained in:
parent
95f543848c
commit
e1a22b315d
|
|
@ -486,10 +486,16 @@ namespace Microsoft.AspNetCore.Http.Connections.Client
|
||||||
{
|
{
|
||||||
httpClientHandler.CookieContainer = _httpConnectionOptions.Cookies;
|
httpClientHandler.CookieContainer = _httpConnectionOptions.Cookies;
|
||||||
}
|
}
|
||||||
if (_httpConnectionOptions.ClientCertificates != null)
|
|
||||||
|
// Only access HttpClientHandler.ClientCertificates if the user has configured client certs
|
||||||
|
// Mono does not support client certs and will throw NotImplementedException
|
||||||
|
// https://github.com/aspnet/SignalR/issues/2232
|
||||||
|
var clientCertificates = _httpConnectionOptions.ClientCertificates;
|
||||||
|
if (clientCertificates?.Count > 0)
|
||||||
{
|
{
|
||||||
httpClientHandler.ClientCertificates.AddRange(_httpConnectionOptions.ClientCertificates);
|
httpClientHandler.ClientCertificates.AddRange(clientCertificates);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_httpConnectionOptions.UseDefaultCredentials != null)
|
if (_httpConnectionOptions.UseDefaultCredentials != null)
|
||||||
{
|
{
|
||||||
httpClientHandler.UseDefaultCredentials = _httpConnectionOptions.UseDefaultCredentials.Value;
|
httpClientHandler.UseDefaultCredentials = _httpConnectionOptions.UseDefaultCredentials.Value;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue