tls_type 添加 TLS1.1 选项,向下兼容

pull/355/head
wulabing 2019-11-27 15:52:23 +08:00
parent 253072f76f
commit 2ba0ccc078
1 changed files with 8 additions and 4 deletions

View File

@ -525,13 +525,17 @@ judge "Nginx systemd ServerFile 添加"
tls_type(){
if [[ -f "/etc/nginx/sbin/nginx" ]] && [[ -f "$nginx_conf" ]];then
echo "请选择支持的 TLS 版本default:1:"
echo "1: TLS1.2 and TLS1.3"
echo "2: TLS1.3 only"
echo "1: TLS1.1 TLS1.2 and TLS1.3"
echo "2: TLS1.2 and TLS1.3"
echo "3: TLS1.3 only"
read -p "请输入:" tls_version
[[ -z ${tls_version} ]] && tls_version=1
if [[ $tls_version == 2 ]];then
[[ -z ${tls_version} ]] && tls_version=2
if [[ $tls_version == 3 ]];then
sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.3;/' $nginx_conf
echo -e "${OK} ${GreenBG} 已切换至 TLS1.3 only ${Font}"
elif [[ $tls_version == 1 ]];then
sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;/' $nginx_conf
echo -e "${OK} ${GreenBG} 已切换至 TLS1.3 only ${Font}"
else
sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.2 TLSv1.3;/' $nginx_conf
echo -e "${OK} ${GreenBG} 已切换至TLS1.2 and TLS1.3 ${Font}"