mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-15 18:12:50 +01:00
Add prompt for SQLServer connection encryption
This commit is contained in:
@@ -501,16 +501,16 @@ namespace Tgstation.Server.Host.Setup
|
||||
}
|
||||
while (true);
|
||||
|
||||
bool useWinAuth;
|
||||
var useWinAuth = false;
|
||||
var encrypt = false;
|
||||
if (databaseConfiguration.DatabaseType == DatabaseType.SqlServer && platformIdentifier.IsWindows)
|
||||
{
|
||||
var defaultResponse = serverAddressEntry?.AddressList.Any(IPAddress.IsLoopback) ?? false
|
||||
? (bool?)true
|
||||
: null;
|
||||
useWinAuth = await PromptYesNo("Use Windows Authentication?", defaultResponse, cancellationToken);
|
||||
encrypt = await PromptYesNo("Use encrypted connection?", false, cancellationToken);
|
||||
}
|
||||
else
|
||||
useWinAuth = false;
|
||||
|
||||
await console.WriteAsync(null, true, cancellationToken);
|
||||
|
||||
@@ -566,6 +566,8 @@ namespace Tgstation.Server.Host.Setup
|
||||
csb.Password = password;
|
||||
}
|
||||
|
||||
csb.Encrypt = encrypt;
|
||||
|
||||
CreateTestConnection(csb.ConnectionString);
|
||||
csb.InitialCatalog = databaseName;
|
||||
databaseConfiguration.ConnectionString = csb.ConnectionString;
|
||||
|
||||
@@ -181,6 +181,8 @@ namespace Tgstation.Server.Host.Setup.Tests
|
||||
"no",
|
||||
//test winauth
|
||||
"yes",
|
||||
// encrypt
|
||||
"YES",
|
||||
//sql server will always fail so reconfigure with maria
|
||||
nameof(DatabaseType.MariaDB),
|
||||
"127.0.0.1",
|
||||
|
||||
Reference in New Issue
Block a user