一個Android APP使用HTTPs訪問兩臺服務器,結果大相徑庭。算法
第一臺IP:192.168.22.119
版本: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
(Android STB) ==> OKapache
[21/Oct/2014:13:52:57 +0800] 192.168.3.33 TLSv1 RC4-MD5 "GET /cgi-bin/server_cgi?name=0022f42
第二臺IP:192.168.22.129
版本: OpenSSL 1.0.1e-fips 11 Feb 2013
(Andriod STB) ==> Fail瀏覽器
[21/Oct/2014:03:09:47 +0000] 192.168.3.33 TLSv1 RC4-MD5 "GET /cgi-bin/server_cgi?name=0022f42
Error Log:服務器
[error] Hostname ABC.upgrade.com provided via SNI and hostname abc.upgrade.com provided via HTTP are different
可是用瀏覽器正常ide
(Chrome) ==> OK加密
[21/Oct/2014:04:06:08 +0000] 192.168.2.7 TLSv1.2 DHE-RSA-AES128-GCM-SHA256 "GET /cgi-bin/server_cgi?name=aaa
(IE 10) ==> OKcode
[21/Oct/2014:05:56:34 +0000] 192.168.2.2 TLSv1 AES128-SHA "GET /cgi-bin/server_cgi?name=0018050
首先弄明白什麼是SNI(Server Name Indication)?
參考 SSL with Virtual Hosts Using SNI
clients在SSL握手的第一個消息中包含的requested hostname, Server根據這個hostname決定正確的named virtual host, 從而能夠繼續創建鏈接
要支持SNI
1. 須要OpenSSL 0.9.8f or later
2. The client browser must also support SNIserver
在Apache Bugzilla上有此Bug: SSL module does not do the case insensitive URI comparison
究其緣由是比較SNI name 和 Http Name時是case-sensitiveblog
More: 不一樣瀏覽器TLS版本不一樣,有V1, V1.2等。所支持的加密算法也不同。ip