-
Notifications
You must be signed in to change notification settings - Fork 397
Description
I use the StorageClient API to list objects, upload objects and download objects. It is working just fine when I try from my laptop but when deployed to Windows Server 2016, I was seeing the above error. Therefore, I requested the Proxy account for my App. Once that is setup, I added the proxy to StorageClient's InnerHandler as specified in this article.
However, this works just fine for listing the objects and upload the objects but it still does not work for DownloadObject. For some reason it still throws the "No such host is known. (storage.googleapis.com:443)" when I make the call to DownloadObject. If I go by amanda-tarafa post I cannot even call List Objects and get the same error.
That said, can anyone tell me why the DownloadOject does not use the proxy that is set in either inner handler or using HttpClientFactory? The code used to set the proxy is as sampled by jskeet and also by amanda-tarafa but nothing works for DownloadObject.
I greatly appreciate if you could help me solve this mystery.
-Vincent D'Souza
Here is the error:
System.Net.Http.HttpRequestException: No such host is known. (storage.googleapis.com:443)
---> System.Net.Sockets.SocketException (11001): No such host is known.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Google.Apis.Download.MediaDownloader.DownloadCoreAsync(String url, Stream stream, CancellationToken cancellationToken)
at Google.Apis.Download.DownloadProgress.ThrowOnFailure(IDownloadProgress progress)