Difference in IIS 6, IIS 7.x and IIS 8 with regards to SSL
here were lot of differences with regards to SSL moving from IIS 6 to IIS 7.x and then to IIS 8. IIS 6 in itself was a breaking change, however there were lot of limitations and they were addressed in higher versions. I will try to pen down as I remember them and will update the blog if I come across other changes. Before I proceed further, for readers who are not familiar with IIS and Windows versions, this is a small info to set the stage: IIS 6 (Windows Server 2003 and Windows XP 64 bit only) IIS 7 (Windows Server 2008 and Windows Vista) IIS 7.5 (Windows Server 2008 R2 and Windows 7) IIS 8 (Windows Server 2012 and Windows 8)
I will be addressing both IIS 7 and IIS 7.5 as IIS 7.x.
Differences from architectural perspective:
One major difference between IIS 6 and the IIS 7.x was the way they would handle incoming HTTPS requests. Lets discuss how HTTPS requests were handled in IIS 6 before we proceed any further.
Taking the above architecture into consideration this is how the IIS 6 request flow looks like:
HTTPS requests comes into SSL Queue within HTTP.SYS, which is in the KERNEL Mode.
The encrypted requests is then sent to a USER Mode process called LSASS.exe for decryption. The request is decrypted using SChannel.dll loaded inside the lsass.exe process.
The decrypted request is not sent back to the HTTP.SYS In the Kernel Mode.
This is now placed in the corresponding Application Pool queue and then routed to corresponding worker process in USER Mode based upon which w3wp.exe a application pool queue corresponds too.
The w3wp.exe generates the response and sends it back to the HTTP.SYS in the KERNEL Mode.
This response is again sent to the Lsass.exe process in the user mode for encryption.
After encryption, lsass.exe sends it back to the HTTP.SYS in the KERNEL mode.
The encrypted response is sent back to the client.
PROBLEM 1:
During the course of the entire processing of request, there were several context switches (Whenever there is a flow of control from KERNEL MODE to USER MODE or vice versa, it is referred as a CONTEXT SWITCH).
There were 6 context switches in the above flow, out of which 4 context switches happened for encrypting and decrypting of request and response.
Context switching induces additional overhead and delays the processing of requests. This impacts the performance as this happens for every HTTPS request-response cycle.
These 4 context switches could have been avoided if the encryption and decryption happened in the KERNEL Mode. This was addressed in IIS 7 and the same was retained in later versions.
PROBLEM 2:
Another problem is the problem with host headers. Host Headers were never defined in the original SSL Specification, as they were part of the HTTP RFCand defined there. The TCP Layer never defined the Host headers for obvious reasons. Due to this, a major problem emerged & made SSL applications not scalable.
Due to the unavailability of the Host Header in the TCP layer, the incoming encrypted HTTPS request provided only IP+Port as information to HTTP.SYS. In IIS the problem was addressed by allowing only one SERVER CERTIFICATE (Certificate Hash) per IP+PORT binding. The SSL Host Header was mostly irrelevant unless the Server Certificate was either a Wild Card Certificate or a SAN Certificate.
This problem was later addressed by the IEEE by introducing Subject Name Indication (SNI). Here the host header was made available in the Client Hello,sent by the client to the serer during the initiation of the SSL Handshake.
This was implemented in IIS 8. However, it has its own set of limitations.