使用acme生成免费的https,ssl证书

生成免费的ssl证书
linux

godaddy 域名为例子

安装acm.sh

curl https://get.acme.sh | sh

注册账号(替换自己的账号)

/root/.acme.sh/acme.sh  --register-account -m abc@gmail.com

导入api key 和证书

export GD_Key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export GD_Secret="xxxxxxxxxxxx"

申请ssl证书

/root/.acme.sh/acme.sh --issue --dns dns_gd -d abc.xyz 

nginx配置

server {
    listen       443 ssl http2;
    server_name  abc.xyz;
       ssl_certificate /root/.acme.sh/abc.xyz_ecc/fullchain.cer;
ssl_certificate_key  /root/.acme.sh/abc.xyz_ecc/abc.xyz.key;
 ssl_session_timeout 5m;
# SSL协议配置
ssl_protocols SSLv2 SSLv3 TLSv1.2 TLSv1.3; #表示使用TLS类型协议
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;#表示使用加密套件的类型
ssl_prefer_server_ciphers on;
  access_log /data/log/nginx/access.log main;

error_log /data/log/nginx/error.log info; location / { try_files $uri $uri/ /index.html; root /data/muerta/dist; index index.html; }

    }

bigcong