示例#1
0
        public override SSLCertificate generateCSR(SSLCertificate certificate)
        {
            var sslObjectService = new SSLModuleService80(SSLFlags, CCSUncPath, CCSCommonPassword);

            sslObjectService.GenerateCsr(certificate);

            return(certificate);
        }
示例#2
0
 /// <remarks/>
 public void DeleteCertificateAsync(SSLCertificate certificate, WebSite website)
 {
     this.DeleteCertificateAsync(certificate, website, null);
 }
示例#3
0
 public ResultObject DeleteCertificate(SSLCertificate certificate, WebSite website)
 {
     object[] results = this.Invoke("DeleteCertificate", new object[] {
                 certificate,
                 website});
     return ((ResultObject)(results[0]));
 }
示例#4
0
 public SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
 {
     object[] results = this.Invoke("installCertificate", new object[] {
                 certificate,
                 website});
     return ((SSLCertificate)(results[0]));
 }
示例#5
0
 /// <remarks/>
 public void generateRenewalCSRAsync(SSLCertificate certificate)
 {
     this.generateRenewalCSRAsync(certificate, null);
 }
示例#6
0
 public SSLCertificate generateRenewalCSR(SSLCertificate certificate)
 {
     object[] results = this.Invoke("generateRenewalCSR", new object[] {
                 certificate});
     return ((SSLCertificate)(results[0]));
 }
 public ResultObject DeleteCertificate(int siteId, SSLCertificate certificate)
 {
     object[] results = this.Invoke("DeleteCertificate", new object[] {
                 siteId,
                 certificate});
     return ((ResultObject)(results[0]));
 }
 /// <remarks/>
 public void InstallCertificateAsync(SSLCertificate certificate, int siteItemId)
 {
     this.InstallCertificateAsync(certificate, siteItemId, null);
 }
示例#9
0
		public SSLCertificate generateRenewalCSR(SSLCertificate certificate)
		{
			try
			{
				Log.WriteStart("'{0}' generateCSR", ProviderSettings.ProviderName);
				certificate = WebProvider.generateCSR(certificate);
				Log.WriteEnd("'{0}' generateCSR", ProviderSettings.ProviderName);
				return certificate;

			}
			catch (Exception ex)
			{
				Log.WriteError(String.Format("'{0}' generateCSR", ProviderSettings.ProviderName), ex);
				throw;
			}
		}
		public static ResultObject DeleteCertificate(int siteId, SSLCertificate certificate)
		{

			ResultObject result = new ResultObject { IsSuccess = true };
			try
			{
				TaskManager.StartTask(LOG_SOURCE_WEB, "DeleteCertificate");
				WebSite item = GetWebSite(siteId) as WebSite;
				WebServer server = GetWebServer(item.ServiceId);
				result = server.DeleteCertificate(certificate, item);
				if (result.IsSuccess)
				{
					DataProvider.DeleteCertificate(SecurityContext.User.UserId, item.PackageId, certificate.id);
				}
				else
				{
					List<string> exceptions = result.ErrorCodes;
					foreach (string s in exceptions)
					{
						TaskManager.WriteError(s.ToString());
					}
				}
			}
			catch (Exception ex)
			{
				TaskManager.WriteError(ex);
				result.IsSuccess = false;
			}
			finally
			{
				TaskManager.CompleteTask();
			}
			return result;
		}
		public static ResultObject InstallCertificate(SSLCertificate certificate, int siteItemId)
		{
			ResultObject result = new ResultObject { IsSuccess = true };
			try
			{
				TaskManager.StartTask(LOG_SOURCE_WEB, "installCertificate");
				TaskManager.WriteParameter("SiteItemId", siteItemId);
				TaskManager.WriteParameter("Hostname", certificate.Hostname);


				WebSite item = GetWebSite(siteItemId) as WebSite;
				TaskManager.WriteParameter("WebSite.Name", item.Name);
				WebServer server = GetWebServer(item.ServiceId);
				TaskManager.WriteParameter("item.ServiceId", item.ServiceId);

                IPAddressInfo ip = ServerController.GetIPAddress(item.SiteIPAddressId);

                if (ip != null)
                    //item.SiteIPAddress = !String.IsNullOrEmpty(ip.InternalIP) ? ip.InternalIP : ip.ExternalIP;
                    item.SiteIPAddress = ip.ExternalIP;

				certificate = server.installCertificate(certificate, item);
				if (certificate.SerialNumber == null)
				{
					result.AddError("Error_Installing_certificate", null);
					result.IsSuccess = false;
				}


				DataProvider.CompleteSSLRequest(SecurityContext.User.UserId, item.PackageId,
												certificate.id, certificate.Certificate,
												certificate.DistinguishedName, certificate.SerialNumber,
												certificate.Hash, certificate.ValidFrom, certificate.ExpiryDate);
				if (certificate.IsRenewal)
				{
					DataProvider.DeleteCertificate(SecurityContext.User.UserId, item.PackageId, certificate.PreviousId);
				}

			}
			catch (Exception ex)
			{
				result.AddError("0", ex);
				TaskManager.WriteError(ex);
			}
			finally
			{
				TaskManager.CompleteTask();
			}
			return result;
		}
		public static SSLCertificate CertificateRequest(SSLCertificate certificate, int siteItemId)
		{

			try
			{
				TaskManager.StartTask(LOG_SOURCE_WEB, "certificateRequest");
				TaskManager.WriteParameter("SiteItemId", siteItemId);
				TaskManager.WriteParameter("Hostname", certificate.Hostname);


				WebSite item = GetWebSite(siteItemId) as WebSite;
				PackageInfo service = PackageController.GetPackage(item.PackageId);
				TaskManager.WriteParameter("WebSite.Name", item.Name);
				WebServer server = GetWebServer(item.ServiceId);
				TaskManager.WriteParameter("item.ServiceId", item.ServiceId);
				certificate.UserID = service.UserId;
				// We want to have a unique identifier for the FriendlyName to help us to identify it easily
				long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
				ticks /= 10000000; // Convert windows ticks to seconds

                //clean up bindings



				certificate.FriendlyName = String.Format("{0}_{1}", certificate.Hostname, ticks.ToString());
				certificate = server.generateCSR(certificate);
				certificate.id = DataProvider.AddSSLRequest(SecurityContext.User.UserId, item.PackageId,
					certificate.SiteID, certificate.UserID, certificate.FriendlyName, certificate.Hostname,
					certificate.CSR, certificate.CSRLength, certificate.DistinguishedName, certificate.IsRenewal,
					certificate.PreviousId);

			}
			catch (Exception ex)
			{
				TaskManager.WriteError(ex);

			}
			finally
			{
				TaskManager.CompleteTask();
			}
			return certificate;

		}
示例#13
0
        public override SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
        {
            var sslObjectService = new SSLModuleService80(SSLFlags, CCSUncPath, CCSCommonPassword);

            return(sslObjectService.InstallCertificate(certificate, website));
        }
示例#14
0
 public override ResultObject DeleteCertificate(SSLCertificate certificate, WebSite website)
 {
     var sslObjectService = new SSLModuleService();
     //
     return sslObjectService.DeleteCertificate(certificate, website);
 }
示例#15
0
 public override SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
 {
     var sslObjectService = new SSLModuleService();
     //
     return sslObjectService.InstallCertificate(certificate, website);
 }
示例#16
0
		public SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
		{
			try
			{
				Log.WriteStart("'{0}' installCertificate", ProviderSettings.ProviderName);
				SSLCertificate result = WebProvider.installCertificate(certificate, website);
				Log.WriteEnd("'{0}' installCertificate", ProviderSettings.ProviderName);
				return result;

			}
			catch (Exception ex)
			{
				Log.WriteError(String.Format("'{0}' generateCSR", ProviderSettings.ProviderName), ex);
				throw;
			}
		}
示例#17
0
 /// <remarks/>
 public System.IAsyncResult BeginInstallCertificate(SSLCertificate certificate, int siteItemId, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("InstallCertificate", new object[] {
                 certificate,
                 siteItemId}, callback, asyncState);
 }
示例#18
0
		public ResultObject DeleteCertificate(SSLCertificate certificate, WebSite website)
		{
			return WebProvider.DeleteCertificate(certificate, website);
		}
示例#19
0
 /// <remarks/>
 public void InstallCertificateAsync(SSLCertificate certificate, int siteItemId, object userState)
 {
     if ((this.InstallCertificateOperationCompleted == null))
     {
         this.InstallCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInstallCertificateOperationCompleted);
     }
     this.InvokeAsync("InstallCertificate", new object[] {
                 certificate,
                 siteItemId}, this.InstallCertificateOperationCompleted, userState);
 }
示例#20
0
		public virtual SSLCertificate installCertificate(SSLCertificate certificate, WebSite website)
		{
			throw new NotSupportedException();
		}
示例#21
0
 /// <remarks/>
 public void DeleteCertificateAsync(int siteId, SSLCertificate certificate)
 {
     this.DeleteCertificateAsync(siteId, certificate, null);
 }
示例#22
0
		public virtual SSLCertificate generateRenewalCSR(SSLCertificate certificate)
		{
			throw new NotSupportedException();
		}
示例#23
0
 /// <remarks/>
 public System.IAsyncResult BegingenerateRenewalCSR(SSLCertificate certificate, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("generateRenewalCSR", new object[] {
                 certificate}, callback, asyncState);
 }
示例#24
0
		public virtual ResultObject DeleteCertificate(SSLCertificate certificate, WebSite website)
		{
			throw new NotSupportedException();
		}
示例#25
0
 /// <remarks/>
 public void generateRenewalCSRAsync(SSLCertificate certificate, object userState)
 {
     if ((this.generateRenewalCSROperationCompleted == null))
     {
         this.generateRenewalCSROperationCompleted = new System.Threading.SendOrPostCallback(this.OngenerateRenewalCSROperationCompleted);
     }
     this.InvokeAsync("generateRenewalCSR", new object[] {
                 certificate}, this.generateRenewalCSROperationCompleted, userState);
 }
示例#26
0
 public SSLCertificate CertificateRequest(SSLCertificate certificate, int siteItemId)
 {
     object[] results = this.Invoke("CertificateRequest", new object[] {
                 certificate,
                 siteItemId});
     return ((SSLCertificate)(results[0]));
 }
示例#27
0
 /// <remarks/>
 public void installCertificateAsync(SSLCertificate certificate, WebSite website)
 {
     this.installCertificateAsync(certificate, website, null);
 }
示例#28
0
 /// <remarks/>
 public void CertificateRequestAsync(SSLCertificate certificate, int siteItemId)
 {
     this.CertificateRequestAsync(certificate, siteItemId, null);
 }
示例#29
0
 /// <remarks/>
 public System.IAsyncResult BeginDeleteCertificate(SSLCertificate certificate, WebSite website, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("DeleteCertificate", new object[] {
                 certificate,
                 website}, callback, asyncState);
 }
示例#30
0
 public ResultObject InstallCertificate(SSLCertificate certificate, int siteItemId)
 {
     object[] results = this.Invoke("InstallCertificate", new object[] {
                 certificate,
                 siteItemId});
     return ((ResultObject)(results[0]));
 }
示例#31
0
 /// <remarks/>
 public void DeleteCertificateAsync(SSLCertificate certificate, WebSite website, object userState)
 {
     if ((this.DeleteCertificateOperationCompleted == null))
     {
         this.DeleteCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteCertificateOperationCompleted);
     }
     this.InvokeAsync("DeleteCertificate", new object[] {
                 certificate,
                 website}, this.DeleteCertificateOperationCompleted, userState);
 }
示例#32
0
        public override SSLCertificate generateCSR(SSLCertificate certificate)
        {
            var sslObjectService = new SSLModuleService();
            //
            sslObjectService.GenerateCsr(certificate);

            return certificate;
        }