try loading cert after gen, always recopy assets
This commit is contained in:
@@ -29,6 +29,12 @@ namespace SPTarkov.Server.Core.Helpers
|
||||
// Generate self-signed certificate
|
||||
certificate = GenerateSelfSignedCertificate("localhost");
|
||||
SaveCertificate(certificate); // Save cert and new key
|
||||
certificate = LoadCertificate();
|
||||
if (certificate == null)
|
||||
{
|
||||
// if we are still null here there is a serious problem creating cert
|
||||
throw new Exception("Certificate could not be loaded for the second time.");
|
||||
}
|
||||
|
||||
_logger.Success($"Generated and stored self-signed certificate ({certificatePath})");
|
||||
}
|
||||
@@ -51,10 +57,14 @@ namespace SPTarkov.Server.Core.Helpers
|
||||
// Generate self-signed certificate
|
||||
certificate = GenerateSelfSignedCertificate("localhost");
|
||||
SaveCertificatePfx(certificate); // Save cert
|
||||
certificate = LoadCertificatePfx(); // load it after
|
||||
if (certificate == null)
|
||||
{
|
||||
// if we are still null here there is a serious problem creating cert
|
||||
throw new Exception("Certificate could not be loaded for the second time.");
|
||||
}
|
||||
|
||||
_logger.Success($"Generated and stored self-signed certificate ({certificatePath})");
|
||||
_logger.Success("First-time generation requires server be restarted for it to pick up cert");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
return certificate;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Remove="appsettings.json" />
|
||||
<Content Include="appsettings.json">
|
||||
|
||||
Reference in New Issue
Block a user