Exemplo n.º 1
0
        private void CertificateValidator_CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke(new CertificateValidationEventHandler(CertificateValidator_CertificateValidation), sender, e);
                return;
            }

            try
            {
                var result = new UntrustedCertificateDialog().ShowDialog(this, e.Certificate);

                if (result == DialogResult.OK)
                {
                    e.Accept = true;
                }
            }
            catch (Exception ex)
            {
                Opc.Ua.Client.Controls.ExceptionDlg.Show(Text, ex);
            }
        }
Exemplo n.º 2
0
        private void CertificateValidator_CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke(new CertificateValidationEventHandler(CertificateValidator_CertificateValidation), sender, e);
                return;
            }

            try
            {
                var result = new UntrustedCertificateDialog().ShowDialog(this, e.Certificate);

                if (result == DialogResult.OK)
                {
                    e.Accept = true;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(Text + ": " + exception.Message);
            }
        }