Skip to content

Commit

Permalink
Hotfix/ssl cert (#70)
Browse files Browse the repository at this point in the history
* remove lettuce for now.

* remove https redirection.

* change https redirection.
  • Loading branch information
PureMunky authored Oct 7, 2020
1 parent 9c9a069 commit 7e0ca67
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Tete.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ public void ConfigureServices(IServiceCollection services)
});
services.AddDbContext<Tete.Api.Contexts.MainContext>(options => options.UseSqlServer(Configuration["ConnectionStrings:DefaultConnection"]));

// services.AddHttpsRedirection(opts =>
// {
// opts.RedirectStatusCode = 308;
// opts.HttpsPort = 443;
// });
services.AddHttpsRedirection(opts =>
{
opts.RedirectStatusCode = 308;
opts.HttpsPort = 443;
});

// services.AddHttpsRedirection(opts =>
// {
// opts.RedirectStatusCode = 307;
// opts.HttpsPort = 443;
// });
services.AddHttpsRedirection(opts =>
{
opts.RedirectStatusCode = 307;
opts.HttpsPort = 443;
});

// services.AddHsts(opts =>
// {
// opts.Preload = true;
// opts.IncludeSubDomains = true;
// opts.MaxAge = TimeSpan.FromHours(2);
// });
services.AddHsts(opts =>
{
opts.Preload = true;
opts.IncludeSubDomains = true;
opts.MaxAge = TimeSpan.FromHours(2);
});

// services
// .AddLettuceEncrypt()
// .PersistDataToDirectory(new System.IO.DirectoryInfo("/var/opt/ssl"), Environment.GetEnvironmentVariable("Certificate_Password"));
services
.AddLettuceEncrypt()
.PersistDataToDirectory(new System.IO.DirectoryInfo("/var/opt/ssl"), Environment.GetEnvironmentVariable("Certificate_Password"));

// In production, the Angular files will be served from this directory
services.AddSpaStaticFiles(configuration =>
Expand All @@ -73,7 +73,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseHsts();
}

app.UseHttpsRedirection();
// app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSpaStaticFiles();

Expand Down

0 comments on commit 7e0ca67

Please sign in to comment.