HTTP And HTTPS Bindings In IIS

What Are Bindings?

Bindings are a collection of elements that define how your website will be accessed.

  • IP Address: IP Address assigned.
  • Port: Assigned port.
  • Host name: domain name.

Where Are These Bindings Stored?

These bindings are stored at “C:\Windows\System32\inetsrv\Config\applicationHost.config”.

<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />

<binding protocol="http" bindingInformation="192.168.56.1:80:test.com" />
</bindings>

</site>

How Is This Configured?

The Window Process Activation Service (WAS) reads the configuration in “applicationHost.config” file. Then, it passes this information to the World Wide Web Publishing Service (WWW Service), which is the listener adapter. Now, the WWW Service goes ahead and configures the HTTP listener (HTTP.sys) with information such as “I am listening on <binding protocol=”http” bindingInformation=”*:80:” /> and <binding protocol=”http” bindingInformation=”192.168.56.1:80:test.com” />

HTTPS Binding

HTTPS is just HTTP protocol over SSL/TLS.

What Is Happening Here?

An IP Address can only have one certificate. It is not possible to have two different certificates attached to one IP Address.

netsh http show sslcert

IP:port: 192.168.56.1:443
Certificate Hash: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb88655
Application ID: {4dc3e181-e14b-4a21-b022-59fc669b0914}
Certificate Store Name: My

But Why Is Only Possible To Have One Certificate Per IP Address?

Think about it. The website needs to determine which certificate to use in order to decrypt traffic. Information at the network layer is not yet encrypted. At this level, we have access to the IP Address. So, by knowing the IP Address, IIS knows which certificate to use in order to decrypt traffic.

How Can We Have Multiples Certificates In One IP Address?

If this must be done, you have two options:

Hostname:port: awesomedefaultwebsite.space:443
Certificate Hash: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXb87331
Application ID : {4dc3e181-e14b-4a21-b022-59fc669b0914}
Certificate Store Name : My

Key Takeaways

  • Bindings are a collection of elements that define how your website will be accessed.
  • Two same bindings cannot coexist.
  • Bindings are stored at “C:\Windows\System32\inetsrv\Config\applicationHost.config”.
  • IIS will only read SSL/TLS certificates at “Local Computer >Personal > Certificates” and in “.pfx” format.
  • netsh http show sslcert” command let us see the ssl bindings.
  • If you have to host multiples certificate under one website you have two options: a) have them share one certificate; b) attach the certificate to the host name, rather than the IP Address (SNI).
  • Server Name Indication (SNI) extends the TLS protocol, allowing to specify the host name in the TLS handshake.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store