問(wèn)題:nginx并配置https證書(shū)支持TLSv1.3
升級(jí)openssl
查看openssl版本openssl version,一般騰訊云為1.0.2k版本。
到官網(wǎng)www.openssl.org
查看最新版本openssl,現(xiàn)在最新為1.1.1h版。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-602720.html
下載最新的openssl
wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
解壓并編譯安裝
tar -zxvf openssl-1.1.1h.tar.gz
cd openssl-1.1.1h
./config --prefix=/usr/local/openssl #如果此步驟報(bào)錯(cuò),需要安裝perl以及gcc包
make && make install
mv /usr/bin/openssl /usr/bin/openssl.bak #此步可以忽略
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl #此步可以忽略
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v # 設(shè)置生效
再次查看openssl版本
openssl version
問(wèn)題:nginx啟動(dòng)報(bào)"ssl parameter requires ngx_http_ssl_module"
- 下載nginx
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0/ #進(jìn)入目錄后執(zhí)行./configure配置后執(zhí)行make命令,make失敗執(zhí)行make lean后重新make
- 重新make下nginx,最后openssl配置上面升級(jí)后的
--prefix= #安裝nginx的位置
--with-openssl=#安裝openssl的位置
./configure --prefix=/usr/local/openresty/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_gzip_static_module --with-stream_ssl_module --with-openssl=/usr/local/openssl-1.1.1t
- 完成后執(zhí)行
make
命令,make失敗執(zhí)行make clean后重新make
- 配置后的nginx.config
server {
listen 80;
server_name www.wetu.top;
return 301 https://$host$request_uri; #轉(zhuǎn)到https
}
server {
listen 443 ssl;
server_name www.wetu.top;
ssl_certificate wetu.top_bundle.crt;
ssl_certificate_key wetu.top.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
- 檢查配置
nginx -t - 啟動(dòng)nginx
./nginx - 停止
./nginx -s stop
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-602720.html
到了這里,關(guān)于nginx配置ssl的坑(TLSv1.3\ngx_http_ssl_module)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!