Skip to content

Commit 3ded845

Browse files
committed
Change URL for monitoring instance when https is enabled
1 parent 2709ff3 commit 3ded845

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/ServiceControlInstaller.Engine/Configuration/Monitoring/SettingsList.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,12 @@ public static class SettingsList
2626
Name = "Monitoring/ShutdownTimeout",
2727
SupportedFrom = new SemanticVersion(6, 4, 1)
2828
};
29+
30+
public static readonly SettingInfo HttpsEnabled = new()
31+
{
32+
Name = "Monitoring/Https.Enabled",
33+
SupportedFrom = new SemanticVersion(6, 9, 0)
34+
};
35+
2936
}
3037
}

src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public MonitoringInstance(WindowsServiceController service)
4040

4141
public bool SkipQueueCreation { get; set; }
4242

43-
public string Url => $"http://{HostName}:{Port}/";
43+
public string Url => $"{UrlScheme}://{HostName}:{Port}/";
44+
45+
public bool HttpsEnabled { get; set; }
46+
string UrlScheme => HttpsEnabled ? "https" : "http";
4447

4548
public string BrowsableUrl
4649
{
@@ -52,7 +55,7 @@ public string BrowsableUrl
5255
"+" => Environment.MachineName.ToLower(),
5356
_ => HostName,
5457
};
55-
return $"http://{host}:{Port}/";
58+
return $"{UrlScheme}://{host}:{Port}/";
5659
}
5760
}
5861

@@ -71,6 +74,8 @@ public override void Reload()
7174
ConnectionString = ReadConnectionString();
7275
Description = GetDescription();
7376
ServiceAccount = Service.Account;
77+
HttpsEnabled = AppConfig.Read(SettingsList.HttpsEnabled, false);
78+
7479
}
7580

7681
string DefaultLogPath()

0 commit comments

Comments
 (0)