示例#1
0
        public static IIS.Binding Add(this IIS.BindingCollection bindingCollection, string bindingInformation, byte[] certificateHash, string certificateStoreName, SslFlags sslFlags)
        {
            var binding = bindingCollection.Add(bindingInformation, certificateHash, certificateStoreName);

            SetSslFlags(binding, sslFlags);

            return(binding);
        }
示例#2
0
 internal Binding(string protocol, string bindingInformation, byte[] hash, string store, SslFlags flags, BindingCollection parent)
     : base(null, "binding", null, parent, null, null)
 {
     BindingInformation   = bindingInformation;
     Protocol             = protocol;
     CertificateHash      = hash;
     CertificateStoreName = store;
     SslFlags             = flags;
     Parent = parent;
 }
示例#3
0
        public static bool RequireElevation(this BindingCollection collection)
        {
            foreach (Binding binding in collection)
            {
                if (binding.EndPoint.Port <= 1024)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#4
0
        private IIS.Binding EnsureBinding(IIS.BindingCollection siteBindings)
        {
            if (siteBindings == null)
            {
                throw new NoHostNameFoundException();
            }

            IIS.Binding iisBinding = siteBindings.FirstOrDefault();

            if (iisBinding == null)
            {
                throw new NoHostNameFoundException();
            }

            return(iisBinding);
        }
示例#5
0
        internal Site(ConfigurationElement element, SiteCollection parent)
            : base(element, "site", null, parent, null, null)
        {
            ApplicationDefaults = ChildElements["applicationDefaults"] == null
                ? new ApplicationDefaults(parent.ChildElements["applicationDefaults"], this)
                : new ApplicationDefaults(ChildElements["applicationDefaults"], this);
            Parent   = parent;
            Bindings = new BindingCollection(ChildElements["bindings"], this);
            if (element == null)
            {
                return;
            }

            foreach (ConfigurationElement node in (ConfigurationElementCollection)element)
            {
                var app = new Application(node, Applications);
                Applications.InternalAdd(app);
            }
        }
示例#6
0
 public Binding(ConfigurationElement element, BindingCollection parent)
     : base(element, "binding", null, parent, null, null)
 {
     Parent = parent;
 }