© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
6 replies
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:
 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);
}
 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
SslProtocols = SslProtocols.Tls12
, I have ensure that on windows 7 tls12 is enabled, Both runtime and program .net framwork are 4.8
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

HttpRequestException:An error occurred while sending the request. WebException
C#CC# / help
2y ago
an error occured while sending an update request
C#CC# / help
2y ago
✅ "An unhandled exception occurred while processing the request."
C#CC# / help
2y ago
❔ An error occurred: 'count' must be non-negative.
C#CC# / help
3y ago