diff --git a/Desktop.Win/app.manifest b/Desktop.Win/app.manifest
new file mode 100644
index 00000000..49e8b2e6
--- /dev/null
+++ b/Desktop.Win/app.manifest
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Server/API/ClientDownloadsController.cs b/Server/API/ClientDownloadsController.cs
index afcc2899..0d90de90 100644
--- a/Server/API/ClientDownloadsController.cs
+++ b/Server/API/ClientDownloadsController.cs
@@ -135,7 +135,9 @@ namespace Remotely.Server.API
var hostIndex = fileContents.IndexOf("HostName=");
var orgIndex = fileContents.IndexOf("Organization=");
- fileContents[hostIndex] = $"HostName=\"{Request.Scheme}://{Request.Host}\"";
+ var effectiveScheme = _appConfig.ForceClientHttps ? "https" : Request.Scheme;
+
+ fileContents[hostIndex] = $"HostName=\"{effectiveScheme}://{Request.Host}\"";
fileContents[orgIndex] = $"Organization=\"{organizationId}\"";
var fileBytes = Encoding.UTF8.GetBytes(string.Join("\n", fileContents));
return File(fileBytes, "application/octet-stream", fileName);
@@ -145,7 +147,8 @@ namespace Remotely.Server.API
{
LogRequest(nameof(GetDesktopFile));
- var serverUrl = $"{Request.Scheme}://{Request.Host}";
+ var effectiveScheme = _appConfig.ForceClientHttps ? "https" : Request.Scheme;
+ var serverUrl = $"{effectiveScheme}://{Request.Host}";
var embeddedData = new EmbeddedServerData(new Uri(serverUrl), organizationId);
var result = await _embeddedDataSearcher.GetRewrittenStream(filePath, embeddedData);
@@ -172,8 +175,9 @@ namespace Remotely.Server.API
{
case "WindowsInstaller":
{
+ var effectiveScheme = _appConfig.ForceClientHttps ? "https" : Request.Scheme;
+ var serverUrl = $"{effectiveScheme}://{Request.Host}";
var filePath = Path.Combine(_hostEnv.WebRootPath, "Content", "Remotely_Installer.exe");
- var serverUrl = $"{Request.Scheme}://{Request.Host}";
var embeddedData = new EmbeddedServerData(new Uri(serverUrl), organizationId);
var result = await _embeddedDataSearcher.GetRewrittenStream(filePath, embeddedData);
@@ -228,10 +232,12 @@ namespace Remotely.Server.API
ip = ip.MapToIPv4();
}
+ var effectiveScheme = _appConfig.ForceClientHttps ? "https" : Request.Scheme;
+
_logger.LogInformation(
"Started client download via {methodName}. Effective Scheme: {scheme}. Effective Host: {host}. Remote IP: {ip}.",
methodName,
- Request.Scheme,
+ effectiveScheme,
Request.Host,
$"{ip}");
}
diff --git a/Server/Pages/ServerConfig.razor b/Server/Pages/ServerConfig.razor
index 24c639e0..3932c83b 100644
--- a/Server/Pages/ServerConfig.razor
+++ b/Server/Pages/ServerConfig.razor
@@ -150,6 +150,13 @@
+
+
+
+
+
+
+
diff --git a/Server/Pages/ServerConfig.razor.cs b/Server/Pages/ServerConfig.razor.cs
index 8af3073f..586c9a44 100644
--- a/Server/Pages/ServerConfig.razor.cs
+++ b/Server/Pages/ServerConfig.razor.cs
@@ -44,6 +44,9 @@ namespace Remotely.Server.Pages
[Display(Name = "Enforce Attended Access")]
public bool EnforceAttendedAccess { get; set; }
+ [Display(Name = "Force Client HTTPS")]
+ public bool ForceClientHttps { get; set; }
+
[Display(Name = "Known Proxies")]
public List KnownProxies { get; set; } = new();
diff --git a/Server/Services/ApplicationConfig.cs b/Server/Services/ApplicationConfig.cs
index 777540ab..f39f8d41 100644
--- a/Server/Services/ApplicationConfig.cs
+++ b/Server/Services/ApplicationConfig.cs
@@ -13,6 +13,7 @@ namespace Remotely.Server.Services
string DBProvider { get; }
bool EnableWindowsEventLog { get; }
bool EnforceAttendedAccess { get; }
+ bool ForceClientHttps { get; }
string[] KnownProxies { get; }
int MaxConcurrentUpdates { get; }
int MaxOrganizationCount { get; }
@@ -50,6 +51,7 @@ namespace Remotely.Server.Services
public string DBProvider => Config["ApplicationOptions:DBProvider"] ?? "SQLite";
public bool EnableWindowsEventLog => bool.Parse(Config["ApplicationOptions:EnableWindowsEventLog"]);
public bool EnforceAttendedAccess => bool.Parse(Config["ApplicationOptions:EnforceAttendedAccess"] ?? "false");
+ public bool ForceClientHttps => bool.Parse(Config["ApplicationOptions:ForceClientHttps"] ?? "false");
public string[] KnownProxies => Config.GetSection("ApplicationOptions:KnownProxies").Get() ?? System.Array.Empty();
public int MaxConcurrentUpdates => int.Parse(Config["ApplicationOptions:MaxConcurrentUpdates"] ?? "10");
public int MaxOrganizationCount => int.Parse(Config["ApplicationOptions:MaxOrganizationCount"] ?? "1");
diff --git a/Server/appsettings.json b/Server/appsettings.json
index 63e9e50f..e2195ee2 100644
--- a/Server/appsettings.json
+++ b/Server/appsettings.json
@@ -17,6 +17,7 @@
"DBProvider": "SQLite",
"EnableWindowsEventLog": false,
"EnforceAttendedAccess": false,
+ "ForceClientHttps": false,
"KnownProxies": [],
"MaxConcurrentUpdates": 10,
"MaxOrganizationCount": 1,
@@ -39,4 +40,4 @@
"UseHsts": false,
"UseHttpLogging": false
}
-}
+}
\ No newline at end of file