CP-38018: Report mismatch between pool and host certificate verification in an undismissable way

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2021-09-19 15:56:33 +01:00
parent 55fd07f8ba
commit d740e83620
3 changed files with 56 additions and 3 deletions

View File

@ -1182,17 +1182,27 @@ namespace XenAdmin.TabPages
s.AddEntry(FriendlyName("host.enabled"), Messages.YES, item);
}
if (isStandAloneHost && Helpers.PostStockholm(host))
if (Helpers.PostStockholm(host))
{
var pool = Helpers.GetPoolOfOne(xenObject.Connection);
if (pool != null && pool.tls_verification_enabled)
if (pool.tls_verification_enabled && host.tls_verification_enabled)
{
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY, Messages.ENABLED);
}
else if (pool.tls_verification_enabled && isStandAloneHost)
{
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY,
Messages.CERTIFICATE_VERIFICATION_HOST_DISABLED_STANDALONE,
Color.Red,
new CommandToolStripMenuItem(new EnableTlsVerificationCommand(Program.MainWindow, pool)));}
else
{
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY,
Messages.DISABLED,
Color.Red,
new CommandToolStripMenuItem(new EnableTlsVerificationCommand(Program.MainWindow, pool)));
}
}
s.AddEntry(FriendlyName("host.iscsi_iqn"), host.GetIscsiIqn(),
@ -1318,12 +1328,31 @@ namespace XenAdmin.TabPages
if (Helpers.PostStockholm(p.Connection))
{
if (p.tls_verification_enabled)
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY, Messages.ENABLED);
{
var disabledHosts = p.Connection.Cache.Hosts.Where(h => !h.tls_verification_enabled).ToList();
if (disabledHosts.Count > 0)
{
var sb = new StringBuilder(Messages.CERTIFICATE_VERIFICATION_HOST_DISABLED_IN_POOL);
foreach (var h in disabledHosts)
sb.AppendLine().AppendFormat(h.Name());
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY,
sb.ToString(),
Color.Red,
new CommandToolStripMenuItem(new EnableTlsVerificationCommand(Program.MainWindow, p)));
}
else
{
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY, Messages.ENABLED);
}
}
else
{
s.AddEntry(Messages.CERTIFICATE_VERIFICATION_KEY,
Messages.DISABLED,
Color.Red,
new CommandToolStripMenuItem(new EnableTlsVerificationCommand(Program.MainWindow, p)));
}
}
var coordinator = p.Connection.Resolve(p.master);

View File

@ -7363,6 +7363,24 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Enabled on the pool, but disabled on:.
/// </summary>
public static string CERTIFICATE_VERIFICATION_HOST_DISABLED_IN_POOL {
get {
return ResourceManager.GetString("CERTIFICATE_VERIFICATION_HOST_DISABLED_IN_POOL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled, but enabled on the pool.
/// </summary>
public static string CERTIFICATE_VERIFICATION_HOST_DISABLED_STANDALONE {
get {
return ResourceManager.GetString("CERTIFICATE_VERIFICATION_HOST_DISABLED_STANDALONE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Certificate Verification.
/// </summary>

View File

@ -2659,6 +2659,12 @@ This will cancel compilation of the status report.</value>
<data name="CERTIFICATE_VERIFICATION_KEY" xml:space="preserve">
<value>Certificate Verification</value>
</data>
<data name="CERTIFICATE_VERIFICATION_HOST_DISABLED_IN_POOL" xml:space="preserve">
<value>Enabled on the pool, but disabled on:</value>
</data>
<data name="CERTIFICATE_VERIFICATION_HOST_DISABLED_STANDALONE" xml:space="preserve">
<value>Disabled, but enabled on the pool</value>
</data>
<data name="CFU_STATUS_CHECK_DESCRIPTION" xml:space="preserve">
<value>Ability to download updates</value>
</data>