C#C
C#2y ago
Behtash

An error occurred while sending the request.

Hi, I have code which works in windows 10 but not working in windows 7:
the code:
C#
 using (var httpClient = new HttpClient(new HttpClientHandler {  
 SslProtocols = SslProtocols.Tls12 })) 
  { 

 Logger.Log.Api(Logger.LogStatus.Success, "Getting " + nameof(GetDomain));

# here error happens after calling ' get async'
 var httpresponse = await httpClient.GetAsync(Url);
}


Error:

The request was aborted: Could not create SSL/TLS secure channel.


More:

I have added
SslProtocols = SslProtocols.Tls12
, I have ensure that on windows 7 tls12 is enabled, Both runtime and program .net framwork are 4.8
Was this page helpful?