Which of the following statements are true regarding Server Name Indication (SNI)? (Choose two.)
A. It supports transparent failover of TLS sessions from one web server to another.
B. It allows multiple SSL/TLS secured virtual HTTP hosts to coexist on the same IP address.
C. It enables HTTP servers to update the DNS of their virtual hosts' names using the X 509 certificates of the virtual hosts.
D. It provides a list of available virtual hosts to the client during the TLS handshake.
E. It submits the host name of the requested URL during the TLS handshake.
題解
先來談談一台 Web 伺服器是如何在同一個 IP 的連接埠上綁上不同的網域,並針對不同網域提供不一樣的網站內容。這個其實要歸功於 HTTP 標頭中的「Host」欄位,當客戶端在向伺服器端要求網站資源時,通常會在 HTTP 標頭中自動加上「Host」欄位,這個欄位的內容即存取的 URL 的網域名稱。於是當 Web 伺服器收到來自於客戶端的請求後,就會依照客戶端的 HTTP 請求之標頭中的「Host」欄位,來選定要提供哪個網站的內容,這個功能稱為「虛擬主機」(Virtual Hosting),不要記成虛擬機器(Virtual Machine)囉!
HTTPS 需要使用 SSL 憑證來建立 SSL/TLS 連線,在早期,一個 IP 位址只能對應一個 SSL 憑證,因為在 SSL/TLS 成功建立連線前,會先確認 SSL 憑證的合法性,若想替不同的虛擬主機使用不同的 SSL 憑證,是無法達成的,因為在 SSL/TLS 成功建立連線前,Web 伺服器無法得知客戶端到底是想存取哪個虛擬主機。於是乎,就變成所有在同一個 IP 下的網站都得使用同一個 SSL 憑證。
為了解決這個問題,SNI (Server Name Indication)便誕生了。SNI 會在建立 TLS 連線前(也就是握手時),客戶端就先將想要存取的虛擬主機名稱明碼傳給 Web 伺服器,讓 Web 伺服器知道要使用哪個虛擬主機所設定的 SSL 憑證。
所以這題答案是選項「B」和選項「E」。
