山东大学软件学院项目实训-创新实训-SDUMeeting(四)
山大会议项目tls加密的实现
服务器证书配置
我用的是let’s encrypt的免费证书,有效期60天,使用acme.sh
管理证书,到期自动刷新。
这里我讲一下let’s encrypt证书的申请
安装acme.sh
运行安装脚本
wget -O - https://get.acme.sh | sh
让 acme.sh 命令生效
..bashrc
开启 acme.sh 的自动升级
acme.sh --upgrade --auto-upgrade
申请证书
设置证书管理机构为letsencrypt,默认是ZeroSSL.com CA(default)
实测不好用,到期不能自动续期。这里设为letsencrypt
acme.sh --set-default-ca --server letsencrypt
申请
acme.sh --issue -d 二级域名.你的域名.com -w /home/vpsadmin/www/webpage --keylength ec-256 --force
拷贝证书到指定文件夹
acme.sh --install-cert -d 二级域名.你的域名.com --ecc \
--fullchain-file ~/指定的文件夹/xxx.crt \
--key-file ~/指定的文件夹/xxx.key