API-MS-WIN_XP
API-MS-WIN_XP copied to clipboard
Windows 7 HTTP2 support
Hi there, recently I was playing with C# HTTP2 server, and after spending hours debuging why firefox won't connect to it (firefox requires TLS), I found out I cannot even make http2 client requests on windows 7 with help of this code
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace ExampleClient
{
//Check HTTP2 support with this website: https://tools.keycdn.com/http2-test
class Program
{
static async Task Main(string[] args)
{
HttpClient myHttpClient = new HttpClient
{
DefaultRequestVersion = HttpVersion.Version20,
DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher
};
string requestUrl = "https://http2cdn.cdnsun.com";
try
{
Console.WriteLine($"GET {requestUrl}.");
HttpResponseMessage response = await myHttpClient.GetAsync(requestUrl);
response.EnsureSuccessStatusCode();
Console.WriteLine($"Response HttpVersion: {response.Version}");
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Response Body Length is: {responseBody.Length}");
Console.WriteLine($"------------Response Body------------");
Console.WriteLine(responseBody);
Console.WriteLine($"------------End of Response Body------------");
}
catch (HttpRequestException e)
{
Console.WriteLine($"HttpRequestException : {e.Message}");
}
Console.WriteLine($"Press Enter to exit....");
Console.ReadLine();
}
}
}
After digging further, I stumbled across this issue: https://github.com/dotnet/runtime/issues/61866 and I found out I am missing a TLS feature: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh831771(v=ws.11)?redirectedfrom=MSDN
and it seams I am not the only one with this problem: https://github.com/curl/curl/issues/840
now do you maybe have any idea, if this can be added (or was already added and I just didn't notice)
Sorry to ask here, but sadly I am not sure whats a good place to even ask this kind of questions, VxEx (still not sure what happened to vxiiduu) is dead, MSFN doesn't seam to be the right place, so I guess here :smile: