Example #1
0
 private void TryPushCertificateInSameSite(string thumbprint)
 {
     if (this.SkipImmediateCertificateDeployment)
     {
         return;
     }
     if (!OAuthTaskHelper.IsDatacenter())
     {
         try
         {
             if (this.serverObject != null)
             {
                 FederationCertificate.PushCertificate(this.serverObject, new Task.TaskProgressLoggingDelegate(base.WriteProgress), new Task.TaskWarningLoggingDelegate(this.WriteWarning), thumbprint);
             }
             else
             {
                 FederationCertificate.PushCertificate(new Task.TaskProgressLoggingDelegate(base.WriteProgress), new Task.TaskWarningLoggingDelegate(this.WriteWarning), thumbprint);
             }
         }
         catch (InvalidOperationException exception)
         {
             base.WriteError(exception, ErrorCategory.InvalidArgument, null);
         }
         catch (LocalizedException exception2)
         {
             base.WriteError(exception2, ErrorCategory.InvalidArgument, null);
         }
     }
 }
Example #2
0
        private void ValidateCertificate(string thumbprint, DateTime?futurePublishDate)
        {
            if (this.DataObject.OrganizationId.OrganizationalUnit != null)
            {
                base.WriteError(new TaskException(Strings.ErrorSettingCertOnTenant), ErrorCategory.InvalidArgument, null);
            }
            bool skipAutomatedDeploymentChecks = OAuthTaskHelper.IsDatacenter() || this.Force;

            if (this.Server == null)
            {
                OAuthTaskHelper.ValidateLocalCertificate(thumbprint, futurePublishDate, skipAutomatedDeploymentChecks, new Task.TaskErrorLoggingDelegate(base.WriteError));
                return;
            }
            OAuthTaskHelper.ValidateRemoteCertificate((string)this.Server, thumbprint, futurePublishDate, skipAutomatedDeploymentChecks, new Task.TaskErrorLoggingDelegate(base.WriteError));
        }
Example #3
0
 private bool ProcessEmergencyCertificateUpdate()
 {
     if (!string.IsNullOrEmpty(this.DataObject.CurrentCertificateThumbprint) && string.Compare(this.DataObject.CurrentCertificateThumbprint, this.CertificateThumbprint, StringComparison.OrdinalIgnoreCase) == 0)
     {
         this.DataObject.CurrentCertificateThumbprint = this.CertificateThumbprint;
         return(true);
     }
     if (!string.IsNullOrEmpty(this.DataObject.NextCertificateThumbprint) && string.Compare(this.DataObject.NextCertificateThumbprint, this.CertificateThumbprint, StringComparison.OrdinalIgnoreCase) == 0)
     {
         base.WriteError(new TaskException(Strings.ErrorCertificateAlreadyinPublish(this.CertificateThumbprint)), ErrorCategory.InvalidArgument, null);
     }
     if (!OAuthTaskHelper.IsDatacenter() && !this.Force && !base.ShouldContinue(Strings.ConfirmationMessageAuthSettingOutage))
     {
         return(false);
     }
     this.DataObject.PreviousCertificateThumbprint = this.DataObject.CurrentCertificateThumbprint;
     this.DataObject.CurrentCertificateThumbprint  = this.CertificateThumbprint;
     this.TryPushCertificateInSameSite(this.CertificateThumbprint);
     return(true);
 }