SNI: 实现多域名虚拟主机的SSL/TLS认证
2014-03-23 00:00
176 查看
一. 介绍 早期的SSLv2根据经典的公钥基础设施PKI(Public Key Infrastructure)设计,它默认认为:一台服务器(或者说一个IP)只会提供一个服务,所以在SSL握手时,服务器端可以确信客户端申请的是哪张证书。 但是让人万万没有想到的是,虚拟主机大力发展起来了,这就造成了一个IP会对应多个域名的情况。解决办法有一些,例如申请泛域名证书,对所有*.yourdomain.com的域名都可以认证,但如果你还有一个yourdomain.net的域名,那就不行了。 在HTTP协议中,请求的域名作为主机头(Host)放在HTTP Header中,所以服务器端知道应该把请求引向哪个域名,但是早期的SSL做不到这一点,因为在SSL握手的过程中,根本不会有Host的信息,所以服务器端通常返回的是配置中的第一个可用证书。因而一些较老的环境,可能会产生多域名分别配好了证书,但返回的始终是同一个。 既然问题的原因是在SSL握手时缺少主机头信息,那么补上就是了。 SNI(Server Name Indication)定义在RFC 4366,是一项用于改善SSL/TLS的技术,在SSLv3/TLSv1中被启用。它允许客户端在发起SSL握手请求时(具体说来,是客户端发出SSL请求中的ClientHello阶段),就提交请求的Host信息,使得服务器能够切换到正确的域并返回相应的证书。 [warning]
要使用SNI,需要客户端和服务器端同时满足条件,幸好对于现代浏览器来说,大部分都支持SSLv3/TLSv1,所以都可以享受SNI带来的便利。[/warning]
二. nginx / apache 服务器端实现 nginx和apache服务端支持SNI参见:
《nginx 同一个IP上配置多个HTTPS主机》
《apache mod_gnutls实现多HTTPS虚拟主机》
三. 支持SNI的浏览器、服务器、库 Internet Explorer 7 or later, on Windows Vista or higher. Does not work on Windows XP, even Internet Explorer 8. Mozilla Firefox 2.0 or later Opera 8.0 or later (the TLS 1.1 protocol must be enabled) Opera Mobile at least version 10.1 beta on Android[citation needed] Google Chrome (Vista or higher. XP on Chrome 6 or newer. OS X 10.5.7 or higher on Chrome 5.0.342.1 or newer) Safari 2.1 or later (Mac OS X 10.5.6 or higher and Windows Vista or higher) Konqueror/KDE 4.7 or later MobileSafari in Apple iOS 4.0 or later Android default browser on Honeycomb or newer Windows Phone 7[citation needed] MicroB on Maemo
四. 支持SNI的服务器 Apache 2.2.12 or later using mod_ssl(or alternatively with experimental mod_gnutls) Cherokee if compiled with TLS support Versions of lighttpd 1.4.x and 1.5.x with patch, or 1.4.24+ without patch Nginx with an accompanying OpenSSL built with SNI support LiteSpeed 4.1 or later Pound 2.6 or later Apache Tomcat on Java 7 or later Microsoft Internet Information Server IIS 8
五. 支持SNI的库 Mozilla NSS 3.11.1 client-side only OpenSSL 0.9.8f (released 11 Oct 2007) – not compiled in by default, can be compiled in with config option ‘–enable-tlsext’ 0.9.8j (released 07 Jan 2009) through 1.0.0 (released 29 March 2010) – compiled in by default GNU TLS libcurl / cURL since 7.18.1 (released 30 Mar 2008) when compiled against an SSL/TLS toolkit with SNI support Python 3.2 (ssl, urllib and httplib modules) Qt 4.8 Oracle Java 7 JSSE 参考文档:http://blog.hesey.net/2012/02/sni-for-multi-domain-ssl-tls.html http://serverfault.com/questions/109800/multiple-ssl-domains-on-the-same-ip-address-and-same-port
要使用SNI,需要客户端和服务器端同时满足条件,幸好对于现代浏览器来说,大部分都支持SSLv3/TLSv1,所以都可以享受SNI带来的便利。[/warning]
二. nginx / apache 服务器端实现 nginx和apache服务端支持SNI参见:
《nginx 同一个IP上配置多个HTTPS主机》
《apache mod_gnutls实现多HTTPS虚拟主机》
三. 支持SNI的浏览器、服务器、库 Internet Explorer 7 or later, on Windows Vista or higher. Does not work on Windows XP, even Internet Explorer 8. Mozilla Firefox 2.0 or later Opera 8.0 or later (the TLS 1.1 protocol must be enabled) Opera Mobile at least version 10.1 beta on Android[citation needed] Google Chrome (Vista or higher. XP on Chrome 6 or newer. OS X 10.5.7 or higher on Chrome 5.0.342.1 or newer) Safari 2.1 or later (Mac OS X 10.5.6 or higher and Windows Vista or higher) Konqueror/KDE 4.7 or later MobileSafari in Apple iOS 4.0 or later Android default browser on Honeycomb or newer Windows Phone 7[citation needed] MicroB on Maemo
四. 支持SNI的服务器 Apache 2.2.12 or later using mod_ssl(or alternatively with experimental mod_gnutls) Cherokee if compiled with TLS support Versions of lighttpd 1.4.x and 1.5.x with patch, or 1.4.24+ without patch Nginx with an accompanying OpenSSL built with SNI support LiteSpeed 4.1 or later Pound 2.6 or later Apache Tomcat on Java 7 or later Microsoft Internet Information Server IIS 8
五. 支持SNI的库 Mozilla NSS 3.11.1 client-side only OpenSSL 0.9.8f (released 11 Oct 2007) – not compiled in by default, can be compiled in with config option ‘–enable-tlsext’ 0.9.8j (released 07 Jan 2009) through 1.0.0 (released 29 March 2010) – compiled in by default GNU TLS libcurl / cURL since 7.18.1 (released 30 Mar 2008) when compiled against an SSL/TLS toolkit with SNI support Python 3.2 (ssl, urllib and httplib modules) Qt 4.8 Oracle Java 7 JSSE 参考文档:http://blog.hesey.net/2012/02/sni-for-multi-domain-ssl-tls.html http://serverfault.com/questions/109800/multiple-ssl-domains-on-the-same-ip-address-and-same-port
相关文章推荐
- SNI: 实现多域名虚拟主机的SSL/TLS认证
- RedHat7配置Nginx实现多域名虚拟主机的SSL/TLS认证(实现单IP以不同证书服务于不同域名)
- Tengine笔记2:通过IP、域名、端口实现虚拟主机
- 1小时搭建个人网站:购买虚拟主机,购买域名,绑定IP和申请SSL证书实现https
- Apache配置虚拟主机,实现多级域名。
- Apache + Tomcat + jk配置负载均衡以及虚拟主机 实现多域名、多用户同时使用
- 基于域名的APACHE虚拟主机实现
- PHP本地实现虚拟域名访问:Apache虚拟主机配置
- 在虚拟主机不支持泛域名绑定的情况下实现自己的域名转发
- apache2虚拟主机实现一个服务器绑定多个域名
- Apache下域名虚拟主机在个人主页目录上实现过程 推荐
- •搭建LAMP环境及快速部署双网站并实现基于域名的虚拟主机
- Tengine笔记2:通过IP、域名、端口实现虚拟主机
- 虚拟主机下实现多域名绑定不同的子目录的方法
- 《当老温遭遇C#》之虚拟主机管理系统 【附核心实现源码】【另可提供中国各大域名服务端接口】[收藏]
- linux下nginx实现虚拟主机(3种方法:基于域名、基于端口、基于ip地址)
- HTTPS-SSL/TSL与SNI的关系以及同IP多域名虚拟主机的SSL/TSL认证
- 利用asp的if语句实现一个虚拟主机“开”多个站点(绑定多个域名)
- 5.2 用单台虚拟主机实现多个域名
- apache实现多域名虚拟主机的SSL认证