Èllïð†
Èllïð†
CC#
Created by Èllïð† on 2/11/2024 in #help
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);
}
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
SslProtocols = SslProtocols.Tls12
, I have ensure that on windows 7 tls12 is enabled, Both runtime and program .net framwork are 4.8
7 replies