標籤:android blog http io os ar 使用 sp div
一個Android APP使用HTTPs訪問兩台伺服器,結果截然不同。
第一台IP:192.168.22.119
版本: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
(Android STB) ==> OK
[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
但是用瀏覽器正常
(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) ==> OK
[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 SNI
在Apache Bugzilla上有此Bug: SSL module does not do the case insensitive URI comparison
究其原因是比較SNI name 和 Http Name時是case-sensitive
More: 不同瀏覽器TLS版本不同,有V1, V1.2等。所支援的密碼編譯演算法也不一樣。
Apache使用OpenSSL遇到的問題