1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

Added debug option to ignore SSL errors

This commit is contained in:
Patrick Simpson 2019-01-08 09:47:14 +02:00
parent 5c722432da
commit f860e83500
2 changed files with 23 additions and 8 deletions

View File

@ -162,6 +162,14 @@ namespace Acacia
}
private static readonly BoolOption RELEASE_ITEM_EVENT_WRAPPERS = new BoolOption("ReleaseItemEventWrappers", true);
[AcaciaOption("If enabled, certificate errors from Z-Push servers are ignored silently.")]
virtual public bool IgnoreCertificateErrors
{
get { return GetOption(null, IGNORE_CERTIFICATE_ERRORS); }
set { SetOption(null, IGNORE_CERTIFICATE_ERRORS, value); }
}
private static readonly BoolOption IGNORE_CERTIFICATE_ERRORS = new BoolOption("IgnoreCertificateErrors", false);
#region UI Options

View File

@ -63,15 +63,22 @@ namespace Acacia.ZPush.Connect
bool allow = false;
if (!_allowCertificateErrors.TryGetValue(request.Host, out allow))
{
ThisAddIn.Instance.InvokeUI(() =>
if (GlobalOptions.INSTANCE.IgnoreCertificateErrors)
{
allow = MessageBox.Show(
string.Format(Properties.Resources.SSLFailed_Body, request.Host),
Properties.Resources.SSLFailed_Title,
MessageBoxButtons.YesNo,
MessageBoxIcon.Error
) == DialogResult.Yes;
});
allow = true;
}
else
{
ThisAddIn.Instance.InvokeUI(() =>
{
allow = MessageBox.Show(
string.Format(Properties.Resources.SSLFailed_Body, request.Host),
Properties.Resources.SSLFailed_Title,
MessageBoxButtons.YesNo,
MessageBoxIcon.Error
) == DialogResult.Yes;
});
}
_allowCertificateErrors.Add(request.Host, allow);
}