I'm trying to get HTTP/2 working with ASP.Net Core 2.2. I'm testing on Windows 10 x64 1809.
I'm using the basic template with the following web host builder:
public static IWebHostBuilder CreateWebHostBuilderKestrel(string[] args)
{
var builder = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Listen(IPAddress.Any, 35000,
lo =>
{
lo.Protocols = HttpProtocols.Http1AndHttp2;
lo.UseHttps(@"path to cert");
});
});
return builder;
}
When using Chrome it accepts the certificate and shows the site over HTTPS. The problem is that it's using HTTP/1.1 and not h2 when checking the network requests in the devtools section.
Using openssl s_client -connect 'host:35000' -cipher "EDH"
gives the following output:
New, TLSv1.2, Cipher is DHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : DHE-RSA-AES256-GCM-SHA384
Session-ID: FA0F0000C66FFFD36BE15AE79B2F48DF631EB83D0425DD534DAA278622CB30AE
Session-ID-ctx:
Master-Key: 2B10E9FD71B42328CAFAFBE18789777132565A98CE8CFD9B8E0452F6490929CB6D1B20AB57A000EDBFF40372C93EB547
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1552937526
Timeout : 7200 (sec)
Verify return code: 20 (unable to get local issuer certificate)
Extended master secret: yes
---
The one thing that looks out of place is "No ALPN negotiated" and "Secure Renegotiation IS supported". Am I missing anything here?
The msdn site lists the following requirements:
TLS version 1.2 or later
Renegotiation disabled
Compression disabled
Minimum ephemeral key exchange sizes:
Elliptic curve Diffie-Hellman (ECDHE) [RFC4492] – 224 bits minimum
Finite field Diffie-Hellman (DHE) [TLS12] – 2048 bits minimum
Cipher suite not blacklisted
Not sure how I'd check most of these settings. Some of these seem like settings of the certificate, while others seem application specific.
OpenSSL 1.1.0i 14 Aug 2018
, so that's not the problem. – Amalea<TargetFramework>netcoreapp2.2</TargetFramework>
– Disrate<TargetFramework>netcoreapp2.2</TargetFramework>
,<PlatformTarget>x64</PlatformTarget>
, and using<PackageReference Include="Microsoft.AspNetCore.App" />
. I assume it might be a problem with the certificate, but no idea how to check that apart from the openssl output. – Amaleadotnet dev-certs https
and use the cert from the store withlo.UseHttps(StoreName.My, "localhost", allowInvalid: true);
– Disrate