diff --git a/Certificates/DotNet Foundation CA.pfx b/Certificates/DotNet Foundation CA.pfx deleted file mode 100644 index 67ce2e415..000000000 Binary files a/Certificates/DotNet Foundation CA.pfx and /dev/null differ diff --git a/Certificates/eShopOnContainers.pfx b/Certificates/eShopOnContainers.pfx deleted file mode 100644 index c5962c1c2..000000000 Binary files a/Certificates/eShopOnContainers.pfx and /dev/null differ diff --git a/src/Services/Identity/Identity.API/Certificates/DotNet Foundation CA.pfx b/src/Services/Identity/Identity.API/Certificates/DotNet Foundation CA.pfx deleted file mode 100644 index 67ce2e415..000000000 Binary files a/src/Services/Identity/Identity.API/Certificates/DotNet Foundation CA.pfx and /dev/null differ diff --git a/src/Services/Identity/Identity.API/Certificates/eShopOnContainers.pfx b/src/Services/Identity/Identity.API/Certificates/eShopOnContainers.pfx deleted file mode 100644 index c5962c1c2..000000000 Binary files a/src/Services/Identity/Identity.API/Certificates/eShopOnContainers.pfx and /dev/null differ diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile index 102fc8c13..3931a135b 100644 --- a/src/Services/Identity/Identity.API/Dockerfile +++ b/src/Services/Identity/Identity.API/Dockerfile @@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 -EXPOSE 443 FROM microsoft/dotnet:2.1-sdk as dotnet-build WORKDIR /src @@ -17,7 +16,6 @@ FROM dotnet-build as build WORKDIR /src/src/Services/Identity/Identity.API/wwwroot COPY --from=node-build /web/wwwroot . WORKDIR /src -COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/ COPY . . WORKDIR /src/src/Services/Identity/Identity.API RUN dotnet restore -nowarn:msb3202,nu1503 diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 22dd039a0..750088608 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -35,16 +35,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API services.Configure(Configuration); - services.AddMvc(opts => - { - opts.SslPort = 4105; - opts.RequireHttpsPermanent = true; - }); - - services.AddHttpsRedirection(opts => - { - opts.HttpsPort = 4105; - }); + services.AddMvc(); if (Configuration.GetValue("IsClusterEnv") == bool.TrueString) { @@ -119,11 +110,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API else { app.UseExceptionHandler("/Home/Error"); - app.UseHsts(); } - app.UseHttpsRedirection(); - var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) { diff --git a/src/Services/Identity/Identity.API/appsettings.json b/src/Services/Identity/Identity.API/appsettings.json index 40cf02804..efee76e88 100644 --- a/src/Services/Identity/Identity.API/appsettings.json +++ b/src/Services/Identity/Identity.API/appsettings.json @@ -2,8 +2,8 @@ "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;", "IsClusterEnv": "False", "MvcClient": "https://localhost:4100", - "SpaClient": "https://localhost:4104", - "XamarinCallback": "https://localhost:4105/xamarincallback", + "SpaClient": "http://localhost:5104", + "XamarinCallback": "http://localhost:5105/xamarincallback", "UseCustomizationData": false, "Logging": { "IncludeScopes": false, diff --git a/src/Web/WebMVC/Certificates/DotNet Foundation CA.pfx b/src/Web/WebMVC/Certificates/DotNet Foundation CA.pfx deleted file mode 100644 index 67ce2e415..000000000 Binary files a/src/Web/WebMVC/Certificates/DotNet Foundation CA.pfx and /dev/null differ diff --git a/src/Web/WebMVC/Certificates/eShopOnContainers.pfx b/src/Web/WebMVC/Certificates/eShopOnContainers.pfx deleted file mode 100644 index c5962c1c2..000000000 Binary files a/src/Web/WebMVC/Certificates/eShopOnContainers.pfx and /dev/null differ diff --git a/src/Web/WebMVC/Dockerfile b/src/Web/WebMVC/Dockerfile index 3b0e08ea4..9847ad772 100644 --- a/src/Web/WebMVC/Dockerfile +++ b/src/Web/WebMVC/Dockerfile @@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 -EXPOSE 443 FROM microsoft/dotnet:2.1-sdk as dotnet-build WORKDIR /src @@ -17,7 +16,6 @@ FROM dotnet-build as build WORKDIR /src/src/Web/WebMVC/wwwroot COPY --from=node-build /web/wwwroot . WORKDIR /src -COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/ COPY . . WORKDIR /src/src/Web/WebMVC RUN dotnet restore -nowarn:msb3202,nu1503 diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index 791ff0336..b760876db 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -1,23 +1,5 @@ -using Microsoft.ApplicationInsights.Extensibility; -using Microsoft.ApplicationInsights.ServiceFabric; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authentication.OpenIdConnect; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.DataProtection; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.eShopOnContainers.WebMVC.Services; +using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.HealthChecks; -using Microsoft.Extensions.Logging; -using Polly; -using Polly.Extensions.Http; -using StackExchange.Redis; -using System; -using System.IdentityModel.Tokens.Jwt; -using System.Net.Http; using WebMVC.Infrastructure; using WebMVC.Infrastructure.Middlewares; using WebMVC.Services; @@ -41,10 +23,6 @@ namespace Microsoft.eShopOnContainers.WebMVC opts.CheckConsentNeeded = context => true; opts.MinimumSameSitePolicy = SameSiteMode.None; }); - services.AddHttpsRedirection(opts=> - { - opts.HttpsPort = 4100; - }); services.AddAppInsight(Configuration) .AddHealthChecks(Configuration) .AddCustomMvc(Configuration) @@ -68,7 +46,6 @@ namespace Microsoft.eShopOnContainers.WebMVC else { app.UseExceptionHandler("/Error"); - app.UseHsts(); } var pathBase = Configuration["PATH_BASE"]; @@ -77,8 +54,7 @@ namespace Microsoft.eShopOnContainers.WebMVC loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'"); app.UsePathBase(pathBase); } - - app.UseHttpsRedirection(); + app.UseCookiePolicy(); #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously @@ -161,11 +137,7 @@ namespace Microsoft.eShopOnContainers.WebMVC services.AddOptions(); services.Configure(configuration); - services.AddMvc(opts=> - { - opts.SslPort = 4100; - opts.RequireHttpsPermanent = true; - }); + services.AddMvc(); services.AddSession(); diff --git a/src/Web/WebMVC/appsettings.json b/src/Web/WebMVC/appsettings.json index 05a1f35c3..a3fd659eb 100644 --- a/src/Web/WebMVC/appsettings.json +++ b/src/Web/WebMVC/appsettings.json @@ -3,8 +3,8 @@ "OrderingUrl": "http://localhost:5102", "BasketUrl": "http://localhost:5103", "MarketingUrl": "http://localhost:5110", - "IdentityUrl": "https://localhost:4105", - "CallBackUrl": "https://localhost:4100/", + "IdentityUrl": "http://localhost:5105", + "CallBackUrl": "http://localhost:5100/", "LocationsUrl": "http://localhost:5109/", "IsClusterEnv": "False", "UseResilientHttp": "True", @@ -23,14 +23,6 @@ "InstrumentationKey": "" }, "HttpClientRetryCount": 8, - "HttpClientExceptionsAllowedBeforeBreaking": 7, - "Kestrel": { - "Certificates": { - "Default": { - "Path": "./Certificates/eShopOnContainers.pfx", - "Password": "D0tNet@" - } - } - } + "HttpClientExceptionsAllowedBeforeBreaking": 7 } \ No newline at end of file diff --git a/src/Web/WebSPA/Dockerfile b/src/Web/WebSPA/Dockerfile index 9a03bce6d..4e806786c 100644 --- a/src/Web/WebSPA/Dockerfile +++ b/src/Web/WebSPA/Dockerfile @@ -2,7 +2,6 @@ ARG NODE_IMAGE=node:8.11 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 -EXPOSE 443 FROM microsoft/dotnet:2.1-sdk as dotnet-build WORKDIR /src @@ -17,7 +16,6 @@ FROM dotnet-build as publish WORKDIR /src/src/Web/WebSPA/wwwroot COPY --from=node-build /web/wwwroot . WORKDIR /src -COPY ./Certificates/eShopOnContainers.pfx /root/.aspnet/https/ COPY . . WORKDIR /src/src/Web/WebSPA RUN dotnet publish -c Release -o /app diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index c0c89f663..e5f1c3412 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -57,20 +57,11 @@ namespace eShopConContainers.WebSPA services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN"); services - .AddMvc(opts => + .AddMvc() + .AddJsonOptions(options => { - opts.SslPort = 4104; - opts.RequireHttpsPermanent = true; - }) - .AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); - - services.AddHttpsRedirection(opts => - { - opts.HttpsPort = 4104; - }); + options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + }); } @@ -85,12 +76,8 @@ namespace eShopConContainers.WebSPA { app.UseDeveloperExceptionPage(); } - else - { - app.UseHsts(); - } - app.UseHttpsRedirection(); + app.UseCookiePolicy(); // Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page // load and passed back token on every subsequent async request diff --git a/src/Web/WebSPA/appsettings.json b/src/Web/WebSPA/appsettings.json index d843edeec..5fb18e7b1 100644 --- a/src/Web/WebSPA/appsettings.json +++ b/src/Web/WebSPA/appsettings.json @@ -1,7 +1,7 @@ { - "IdentityUrl": "https://localhost:4105", + "IdentityUrl": "http://localhost:5105", "MarketingUrl": "http://localhost:5110", - "CallBackUrl": "https://localhost:4104/", + "CallBackUrl": "http://localhost:4104/", "PurchaseUrl": "http://localhost:5200", "UseCustomizationData": true, "IsClusterEnv": "False",