<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[Nginx开启单IP多SSL证书支持-TLS SNI support]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[服务器类]]></category>
<pubDate>Wed, 21 Dec 2016 03:17:19 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	Nginx支持单IP多域名SSL证书需要OpenSSL支持，由于CentOS5.X系统自带的OpenSSL版本太低不支持，所以首先需要编译安装一个高版本的openssl，CentOS 6.X的系统自带的openssl版本大于0.98以上，一般编译好的nginx都是支持的。<br/><br/>检查nginx是否支持TLS SNI support：<br/>/usr/local/nginx/sbin/nginx -V<br/>nginx version: nginx/1.10.2<br/>TLS SNI support disabled<br/>configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module<br/><br/>TLS SNI support disabled 这样是不支持的。<br/><br/>查看openssl的版本：<br/><textarea name="code" class="c" rows="15" cols="100">[root@localhost ~]# openssl version -a
OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
built on: Tue May 31 06:58:30 CDT 2016
platform: linux-x86_64
options:&nbsp;&nbsp;bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,16,int) blowfish(ptr2) 
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -I/usr/kerberos/include -DL_ENDIAN -DTERMIO -Wall -DMD32_REG_T=int -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DOPENSSL_USE_NEW_FUNCTIONS -fno-strict-aliasing -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM
OPENSSLDIR: &quot;/etc/pki/tls&quot;
engines:&nbsp;&nbsp;dynamic 
</textarea><br/><br/>下面开始升级openssl：<br/>wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz<br/>tar xzvf openssl-1.0.2h.tar.gz<br/>cd openssl-1.0.2h<br/>./config --prefix=/usr/local/openssl/ enable-shared enable-tlsext<br/>make &amp;&amp; make install<br/><br/>检查openssl的版本：<br/><textarea name="code" class="c" rows="15" cols="100">[root@localhost ~]# /usr/local/openssl/bin/openssl version -a
OpenSSL 1.0.2h&nbsp;&nbsp;21 Dec 2016
built on: reproducible build, date unspecified
platform: linux-x86_64
options:&nbsp;&nbsp;bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: gcc -I. -I.. -I../include&nbsp;&nbsp;-fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: &quot;/usr/local/openssl/ssl&quot;
</textarea><br/><br/>编译nginx：<br/><textarea name="code" class="c" rows="15" cols="100">wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar xzvf nginx-1.10.2.tar.gz
cd nginx-1.10.2/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module
make &amp;&amp; make install</textarea><br/><br/>检查现在是否支持TLS SNI support：<br/><textarea name="code" class="c" rows="15" cols="100">[root@localhost ~]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.10.2
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-55)
built with OpenSSL 1.0.2h&nbsp;&nbsp;21 Dec 2016
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module</textarea><br/><br/>TLS SNI support enabled 现在已经支持了，再添加几个https的站点都正常了。<br/><br/><br/>Tags - <a href="http://www.zhanghaijun.com/tags/nginx/" rel="tag">nginx</a> , <a href="http://www.zhanghaijun.com/tags/https/" rel="tag">https</a> , <a href="http://www.zhanghaijun.com/tags/ssl/" rel="tag">ssl</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] Nginx开启单IP多SSL证书支持-TLS SNI support]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>