I've got a problem when using SignalR on Xamarin-PCL project. The error occurred when connection.start() (The hub url is https) method, But it's worked perfectly on Android.
This is the error message
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error getting response stream (ReadDone1): ReceiveFailure ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. --->
Change the SSL/TLS implementation to "Mono (TLS v1.0)"
Related
I'm using the TMDbLib https://www.nuget.org/packages/TMDbLib/ 1.9.2 (upgraded due to error bellow) to grab info about TV shows. Until a day or so ago, this has been working.
Some aspects are still working. I've checked my API Key, and that is valid.
I'm getting the following errors
// Access to The Movie DB API
TMDbClient client = new TMDbClient(<API KEY>);
Error: but no exception
'client.Config' threw an exception of type 'System.InvalidOperationException'
Then
var NewEpisode = client.GetTvEpisodeAsync(TMDBid, SeasonNumber, Epnum).Result;
Error: with exceptions
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
HttpRequestException: An error occurred while sending the request.
Inner Exception 2:
WebException: The underlying connection was closed: An unexpected error occurred on a receive.
Inner Exception 3:
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Inner Exception 4:
SocketException: An existing connection was forcibly closed by the remote host
Are these related, and how might I fix this? BTW I have Fast internet.
I think I've fixed this
Putting here in case someone else has similar issues
themoviedb.org uses TLS 1.3
Turns out I was using an older version of .NET framework that doesn't support TLS 1.3
Ref:
https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls
and
The request was aborted could not create SSL/TLS secure channel - HttpWebRequest
Uninstalled TMDBLib and System.Net.Http
Updated to newer .Net Framework
Reinstalled TMDBLib, System.Net.Http is a dependency so gets installed by default
We start getting errors for SSL handshake, the error is happening only few times but still we want to find the case
The full error is:
Failed to send HTTP request with error code 'generic:1' Inner exception: [http_exception: 'Error in SSL handshake']
CorrelationId=b264041d-506a-4ab9-be0f-cc0e15ae45d8
CorrelationId.Description=FileHandler
HttpRequest.Id=27455c0d-602c-42f1-b13c-f67fc4762051
HttpRequest.SanitizedUrl=https://api.aadrm.com/my/v2/publishinglicenses
NetworkError.Category=Unknown
did anyone has faced this issue?
We have developed WCF service and hosted as windows service. We have written .net core client application.
We have observed that the service is not responding after a few calls. It gets stopped somehow.
I tried to create logging and trace in WCF service but it is not creating any .svclog file.
In exception handling, it gives the following message
Exception: One or more errors occurred. (An error occurred while
sending the request.) System.ServiceModel.CommunicationException: An
error occurred while sending the request. --->
System.Net.Http.HttpRequestException: An error occurred while sending
the request. ---> System.IO.IOException: Unable to read data from the
transport connection: An existing connection was forcibly closed by
the remote host.. ---> System.Net.Sockets.SocketException (10054): An
existing connection was forcibly closed by the remote host. --- End
of inner exception stack trace --- at
System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError
error, CancellationToken cancellationToken) at
System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16
token) at
System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage
request, CancellationToken cancellationToken)
I want to know what forced the service to be stopped? How can I find this?
Here is my code:
string url = "https://myOrg.api.crm.dynamics.com";
string apiVersion = "9.1";
string webApiUrl = $"{url}/api/data/v{apiVersion}/";
var authParameters = AuthenticationParameters.CreateFromResourceUrlAsync(new Uri(webApiUrl)).Result;
My last line of code is failing with:
The ouput is:
MyAPITest.vshost.exe Error: 0 : 11/05/2019 19:20:17: - AuthenticationParameters: System.ArgumentException: Unauthorized Http Status Code (401) was expected in the response
Parameter name: response
Exception thrown: 'System.AggregateException' in mscorlib.dll
The program '[5556] MyAPITest.vshost.exe' has exited with code -1 (0xffffffff).
For reference, I am attempting to use the Quick Start Guide to connect to the Common Data Service.
EDIT:
In looking at the details I am seeing:
Error
The underlying connection was closed: An unexpected error occured on a send.
More detail beneath that error:
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
AuthenticationParameters: System.ArgumentException: Unauthorized Http Status Code (401) was expected in the response
The error is typically because it's lacking valid authentication credentials and the request has not been applied for the target resource.
Also if you don't know, the AuthenticationParameters.CreateFromResourceUrlAsync API is obsolete, read more there.
With this in mind, I would look into using AuthenticationParameters.CreateFromUrlAsync(Uri) Method in which should be used. It sends a GET request to the url provided with no Authenticate header. If a 401 Unauthorized is received, this helper will parse the WWW-Authenticate header to retrieve the authority and resource.
Here was the problem, found in the guide:
I am running VS 2015. Once I unchecked this, it worked perfectly.
I am trying to connect to a Azure Blob Storage account from an App Service hosted within the same location and in the same resource group. However when attempting to create a container during startup I get the following exception:
System.AggregateException: One or more errors occurred. (An error
occurred while sending the request.) --->
Microsoft.WindowsAzure.Storage.StorageException: An error occurred
while sending the request. ---> System.Net.Http.HttpRequestException:
An error occurred while sending the request. --->
System.Net.Http.WinHttpException: A connection with the server could
not be established
The inner exception is:
Microsoft.WindowsAzure.Storage.StorageException: An error occurred while sending the request. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A connection with the server could not be established
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
at System.Net.Http.WinHttpHandler.d__105.MoveNext()
--- End of inner exception stack trace ---
I have double checked the account name, URL and access keys. I have also tried cycling the access keys to be sure. I have tried connecting to another storage account from the same app service and that also fails.
There are no app firewalls or VNets in place on either resource and I am at a loss as to what could be causing the issue.