Closed amather closed 1 year ago
Would something like this suffice... GoogleLogListApi HttpClient Ctor? Note, that you will have to correctly set the base address of the HttpClient
that you pass through.
Otherwise if you wanted to do something more complex, like support a different log list provider, you could create a custom implementation of ILogListApi
.
Hi! I just discovered that it is indeed possible to configure the auth from the outside, so that no changes to this project are required.
While the DefaultProxy
itself is read-only, its .Credentials
property can be set. This way, I can configure the DefaultProxy
with credentials before the HttpClient
instance within GoogleLogListApi
is created.
My code now looks like this and works fine with this library:
var systemProxy = HttpClient.DefaultProxy.GetProxy(new(GeorgeClient.BaseUrl)) ;
if(systemProxy != null && _httpClientHandler.Proxy == null && _httpClientHandler.SupportsProxy)
{
HttpClient.DefaultProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
}
_httpClient = new(_httpClientHandler);
Thanks for your efforts though!
Hello!
The library fails to work in an environment where internet access is only available via an authenticated proxy. While
HttpClient
does detect the system proxy it does not detect the required authentication credentials.For example, that's the
HttpClient
I use in my app:I don't need any proxy auto-configuration from this library, but I'd be great if at least
GoogleLogListApi
could support another constructor to which I could supply my ownHttpClient
. Then I could create my ownInstance
class and continue using that. Would that be a change you're willing to implement?Thanks!