Fixed: SSL Binding was binding as http instead of https
This commit is contained in:
parent
add6197ae1
commit
4cb79c25c7
1 changed files with 17 additions and 5 deletions
|
@ -437,7 +437,7 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
//
|
||||
lock (((ICollection)iisObject.ChildElements).SyncRoot)
|
||||
{
|
||||
// remove all "http" bindings
|
||||
// remove all "http" and "https" bindings
|
||||
int i = 0;
|
||||
while (i < iisObject.Bindings.Count)
|
||||
{
|
||||
|
@ -446,6 +446,11 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
iisObject.Bindings.RemoveAt(i);
|
||||
continue;
|
||||
}
|
||||
else if (String.Equals(iisObject.Bindings[i].Protocol, Uri.UriSchemeHttps, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
iisObject.Bindings.RemoveAt(i);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
|
@ -454,10 +459,17 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
|
||||
// Create HTTP bindings received
|
||||
foreach (var serverBinding in bindings)
|
||||
{
|
||||
var bindingInformation = String.Format("{0}:{1}:{2}", serverBinding.IP, serverBinding.Port, serverBinding.Host);
|
||||
iisObject.Bindings.Add(bindingInformation, Uri.UriSchemeHttp);
|
||||
}
|
||||
if (serverBinding.Port != "443")
|
||||
{
|
||||
var bindingInformation = String.Format("{0}:{1}:{2}", serverBinding.IP, serverBinding.Port, serverBinding.Host);
|
||||
iisObject.Bindings.Add(bindingInformation, Uri.UriSchemeHttp);
|
||||
}
|
||||
else
|
||||
{
|
||||
var bindingInformation = String.Format("{0}:{1}:{2}", serverBinding.IP, serverBinding.Port, serverBinding.Host);
|
||||
iisObject.Bindings.Add(bindingInformation, Uri.UriSchemeHttps);
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
srvman.CommitChanges();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue