React to UseHttps change

This commit is contained in:
Stephen Halter 2017-01-09 19:58:22 -08:00
parent 9917e8bb30
commit fa64b0c0fb
2 changed files with 26 additions and 9 deletions

View File

@ -1,4 +1,6 @@
using System.IO; using System;
using System.IO;
using System.Net;
using System.Reflection; using System.Reflection;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -13,11 +15,17 @@ namespace OpenIdConnectSample
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel(options => .UseKestrel(options =>
{ {
// Configure SSL if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNETCORE_PORT")))
var serverCertificate = LoadCertificate(); {
options.UseHttps(serverCertificate); // ANCM is not hosting the process
options.Listen(IPAddress.Loopback, 44318, listenOptions =>
{
// Configure SSL
var serverCertificate = LoadCertificate();
listenOptions.UseHttps(serverCertificate);
});
}
}) })
.UseUrls("https://localhost:44318")
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()

View File

@ -1,4 +1,6 @@
using System.IO; using System;
using System.IO;
using System.Net;
using System.Reflection; using System.Reflection;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -14,9 +16,16 @@ namespace SocialSample
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel(options => .UseKestrel(options =>
{ {
//Configure SSL if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNETCORE_PORT")))
var serverCertificate = LoadCertificate(); {
options.UseHttps(serverCertificate); // ANCM is not hosting the process
options.Listen(IPAddress.Loopback, 5000, listenOptions =>
{
// Configure SSL
var serverCertificate = LoadCertificate();
listenOptions.UseHttps(serverCertificate);
});
}
}) })
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()