阿里DigiCert 免费版 SSL证书过期,如何处理

今天打开网站发现SSL证书过期,之前是一把锁,现在是一个惊叹号,点击惊叹号,显示证书无效。内容如下“

您的连接不是私密连接
攻击者可能会试图从 test.com 窃取您的信息(例如:密码、通讯内容或信用卡信息)。了解详情
NET::ERR_CERT_DATE_INVALID
如果您想获得 Chrome 最高级别的安全保护,请开启增强型保护
此服务器无法证明其所在网域是 test.com;其安全证书已在 13 天前过期。出现此问题的原因可能是配置有误,或是有攻击者拦截您的连接。计算机的时钟目前已设为 2022年8月3日星期三,请问是否正确?如果不正确,请更正系统的时钟,然后刷新此页面。

继续前往www.test.com(不安全)

那么阿里DigiCert 免费版 SSL证书过期,如何处理,下面是解决文案:

一、登录阿里打开下面的网址,并操作

https://yundun.console.aliyun.com/?p=cas#/certExtend/free
立即购买0元支付,然后创建证书,申请证书,通过之后下载证书并解压得到下面两个文件
1234567_test.com.key
1234567_test.com.pem

二、登录linux,并配置nginx

使用PuTTY登录linux

Welcome to Alibaba Cloud Elastic Compute Service !

Activate the web console with: systemctl enable --now cockpit.socket

Last login: Wed Aug  3 10:28:15 2022 from xxx.xxx.xx..xxx
[root@xxx ~]# cd /usr/local/nginx/
[root@xxx nginx]# ll
[root@xxx nginx]# cd conf/
[root@xxx conf]# ll
[root@xxx conf]# cd cert/
[root@xxx cert]# ll
[root@xxx cert]# vi 1234567_test.com.key
编辑文件,把1234567_test.com.key里的文件复制粘贴到这里,保存退出
[root@xxx cert]# vi 1234567_test.com.pem
编辑文件,把1234567_test.com.pem里的文件复制粘贴到这里,保存退出
[root@xxx cert]# ll
-rw-r--r-- 1 root root 1676 Aug  3 10:58 1234567_test.com.key
-rw-r--r-- 1 root root 3806 Aug  3 10:59 1234567_test.com.pem
[root@xxx cert]# cd ../
[root@xxx conf]# ll
[root@xxx conf]# cd vhost/
[root@xxx vhost]# ll
-rw-r--r-- 1 root root 1605 Sep 30  2021 test.conf
[root@xxx vhost]# vi test.conf

编辑配置文件
----------------------------------------------------------------------------
server {
        listen 80;
        server_name www.test.com test.com;
        rewrite ^/.*$ https://www.test.com permanent;
}

server {
        listen 443 ssl;
        server_name www.test.com;
        root /data/www/test/public;
        index index.html index.htm index.php;

        ssl_certificate /usr/local/nginx/conf/cert/1234567_test.com.pem;
        ssl_certificate_key /usr/local/nginx/conf/cert/1234567_test.com.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;

        location /wss
        {
                proxy_pass http://127.0.0.1:9091;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header X-Real-IP $remote_addr;
        }


        location / {
               try_files $uri $uri/ /index.php?$query_string;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|json|swg)$ {
                        expires      30d;
        }
        location ~ .*\.(js|css)?$ {
                        expires      12h;
        }

        location ~ ^.+\.php {
                #fastcgi_pass   bakend;
                fastcgi_pass   unix:/usr/local/php/var/run/php-cgi.sock;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                fastcgi_param  PATH_INFO          $fastcgi_path_info;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi.conf;
        }

        access_log  /data/www/nginx_log/test.log access;
}

-------------------------------------------------------------------------------------------

:wq保存退出


[root@xxx vhost]# cd /usr/local/nginx/sbin/
[root@xxx sbin]# ./nginx -s reload
[root@xxx sbin]# exit

至此结束。

再次打开网站就出现一把锁了。点击那把锁,显示连接是安全的,证书有效。

你可能感兴趣的:(nginx,域名ssl,ssl,网络协议,网络)