Reputation: 309
With Kestrel I can do the following:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http1"
}
}
}
to make it run in HTTP1.1 mode.
How can I achieve the same with IIS Express? At the moment it is defaulting to HTTP2
Upvotes: 0
Views: 71
Reputation: 28232
If you just want to test with http 1.1 with asp.net core application, there is no need to set the IIS express setting.
Inside the asp.net core to use the http 2, it must use the https and the tls version should be TLS 1.2 or later connection.
So you just need to set the asp.net core launch settings and program.cs to disable the https redirect.
More details, you could refer to below codes:
1.Modify the program.cs to disable https redirect.
...
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
//remove the https redirection
//app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
...
Use the http to access the web site.
Result:
Upvotes: 0