Fix cert issue
This commit is contained in:
1 parent
65a71c5b5f
commit
f5feec81f1
3 files changed
+4
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using BudgetApp.Components;
|
||||
@@ -9,9 +10,7 @@ using BudgetApp.Data.Interfaces;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Host.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.ConfigureKestrel(options =>
|
||||
builder.WebHost.ConfigureKestrel(options =>
|
||||
{
|
||||
options.ConfigureHttpsDefaults(adapterOptions =>
|
||||
{
|
||||
@@ -20,7 +19,7 @@ builder.Host.ConfigureWebHostDefaults(webBuilder =>
|
||||
|
||||
if (File.Exists(pemCertFile) && File.Exists(pemKeyFile))
|
||||
{
|
||||
adapterOptions.ServerCertificate = System.Security.Cryptography.X509Certificates.X509Certificate2.CreateFromPemFile(pemCertFile, pemKeyFile);
|
||||
adapterOptions.ServerCertificate = X509Certificate2.CreateFromPemFile(pemCertFile, pemKeyFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -29,7 +28,6 @@ builder.Host.ConfigureWebHostDefaults(webBuilder =>
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Database
|
||||
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||
@@ -121,6 +119,7 @@ builder.Services.AddRazorComponents()
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
// Auto-migrate database
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user