You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.
If I enable both SSL in Kestrel and IISIntegration the app hangs on the first request when I run it in VS using IIS Express:
usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Threading.Tasks;usingMicrosoft.AspNetCore.Hosting;usingMicrosoft.Extensions.Configuration;usingMicrosoft.Extensions.Logging;usingMicrosoft.AspNetCore.Server.Kestrel;usingMicrosoft.AspNetCore.Server.Kestrel.Core;usingMicrosoft.AspNetCore.Server.Kestrel.Https;usingSystem.Security.Cryptography.X509Certificates;usingSystem.Net;namespacemvc_individual{publicclassProgram{publicstaticvoidMain(string[]args){varhost=newWebHostBuilder().UseKestrel(options =>{options.Listen(IPAddress.Loopback,44316, listenOptions =>{listenOptions.UseHttps("danroth27.com",StoreName.My,StoreLocation.CurrentUser);});}).UseContentRoot(Directory.GetCurrentDirectory()).UseIISIntegration().ConfigureAppConfiguration((context,configBuilder)=>{configBuilder.AddJsonFile("appsettings.json",optional:false,reloadOnChange:true).AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json",optional:true);if(context.HostingEnvironment.IsDevelopment()){// For more details on using the user secret store see https://go.microsoft.com/fwlink/?LinkID=532709configBuilder.AddUserSecrets<Startup>();}configBuilder.AddEnvironmentVariables();}).ConfigureLogging(loggerFactory =>loggerFactory.AddConsole().AddDebug()).UseStartup<Startup>().Build();host.Run();}}publicstaticclassKestrelServerOptionsHttpsX509StoreExtensions{publicstaticListenOptionsUseHttps(thisListenOptionsoptions,stringsubjectName,StoreNamestoreName,StoreLocationstoreLocation){varcertStore=newX509Store(storeName,storeLocation);certStore.Open(OpenFlags.ReadOnly);varcertificates=certStore.Certificates.Find(X509FindType.FindBySubjectName,subjectName,validOnly:false);varcertificate=certificates.OfType<X509Certificate2>().First();returnoptions.UseHttps(certificate);}}}
The text was updated successfully, but these errors were encountered:
The ordering in Hosting is wrong. UseIISIntegration sets the option in ConfigureServices (or HostingStartupAssemblies), but WebHost reads the option before that. The fix is to read the option directly from config rather than via options, like we do for the urls.
If I enable both SSL in Kestrel and IISIntegration the app hangs on the first request when I run it in VS using IIS Express:
The text was updated successfully, but these errors were encountered: