First commit of SNI and CCS support in the IIS80 Provider. Only small changes to IIS70 to allow inheritance.

This commit is contained in:
Olov Karlsson 2014-10-22 21:34:14 +02:00
parent bb67d603e2
commit 4d44baa817
11 changed files with 841 additions and 47 deletions

View file

@ -76,10 +76,10 @@ namespace WebsitePanel.Portal
set { ViewState["PackageId"] = value; }
}
private bool IsDedicatedIP
private bool AllowSsl
{
get { return (bool)ViewState["IsDedicatedIP"]; }
set { ViewState["IsDedicatedIP"] = value; }
get { return (bool)ViewState["AllowSsl"]; }
set { ViewState["AllowSsl"] = value; }
}
private bool IIs7
@ -111,7 +111,7 @@ namespace WebsitePanel.Portal
// remove "SSL" tab for a site with dynamic IP
var sslTab = filteredTabs.SingleOrDefault(t => t.Id == "SSL");
if (!IsDedicatedIP && sslTab != null)
if (!AllowSsl && sslTab != null)
filteredTabs.Remove(sslTab);
@ -277,15 +277,24 @@ namespace WebsitePanel.Portal
webSitesCustomErrorsControl.BindWebItem(site);
webSitesHeliconZooControl.BindWebItem(site);
if (site.IsDedicatedIP)
// If SNI is enabled on the server, we do allow for SSL even if site not has dedicated Ip
var sniEnabled = false;
var serverSettings = ES.Services.Servers.GetServiceSettings(site.ServiceId);
var sniEnabledItem = serverSettings.FirstOrDefault(s => s.StartsWith("sslusesni"));
if (sniEnabledItem != null)
{
sniEnabled = Utils.ParseBool(sniEnabledItem.Split('=')[1], false);
}
if (site.IsDedicatedIP || sniEnabled)
{
IsDedicatedIP = true;
AllowSsl = true;
WebsitesSSLControl.Visible = true;
WebsitesSSLControl.BindWebItem(site);
}
else
{
IsDedicatedIP = false;
AllowSsl = false;
WebsitesSSLControl.Visible = false;
}