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」。