Binding.Protocol Property

IIS 7.0

Gets or sets the protocol the binding will use.

Namespace:   Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public string Protocol { get; set; }

Property Value

Type: System.String

The protocol identifier for the binding.

A value of "http" indicates a binding that uses the HTTP protocol. A value of "https" indicates a binding that uses HTTP over SSL.

The Protocol property value is maintained in the ApplicationHost.config file.

The following example demonstrates the Protocol property. If the protocol identifier is "https", the certificate hash and certificate store name are displayed. This code example is part of a larger example provided for the Binding class.

if (binding.Protocol == "https")
     // There is a CertificateHash and  
     // CertificateStoreName for the https protocol only.
    bindingdisplay = bindingdisplay + "\n   CertificateHash: " + 
        binding.CertificateHash + ": ";
    // Display the hash.
    foreach (System.Byte certhashbyte in binding.CertificateHash)
        bindingdisplay = bindingdisplay + certhashbyte.ToString() + " ";
    bindingdisplay = bindingdisplay + "\n   CertificateStoreName: " + 
Return to top