大网数据广告活动
服务器运维问答

New Let'sencrypt certificate ERR_CERT_DATE_INVALID

· 52CE 我爱测

Ubuntu 20.04 Nginx I obtained a certificate with certbot like sudo certbot --nginx -d pvapp-2021.umwelt-campus.de. And included the paths to the certificate to my two nginx config files (one for the frontend and one as reverse pr…

问题原文

原帖链接 · why me · CC BY-SA 4.0

Ubuntu 20.04 Nginx

I obtained a certificate with certbot like sudo certbot --nginx -d pvapp-2021.umwelt-campus.de. And included the paths to the certificate to my two nginx config files (one for the frontend and one as reverse proxy for node) like:

 ssl_certificate /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/privkey.pem;

 include /etc/letsencrypt/options-ssl-nginx.conf;

When now making requests to my backend (e.g. logging in) I get the error:
Failed to load resource: net::ERR_CERT_DATE_INVALID tho the certificate definitely is valid.

Do I need a extra certificate for my backend? If yes, how would I do this? What else could cause the error?

Also sudo certbot renew --dry-run fails.

My nginx node conf: (ssl part)

server {
     listen       443 ssl;
     listen       [::]:443 ssl http2;
     server_name  pvapp-2021.umwelt-campus.de;

     # point to ssl certificate path
     ssl_certificate /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/privkey.pem; # managed by Certbot

     include /etc/letsencrypt/options-ssl-nginx.conf;

     root /var/www/client/pvapp-client/dist;
     error_page 404 =200 /index.html;

     location /backend {
          proxy_pass http://localhost:60702;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
          proxy_ssl_verify off;
     }

Appreciate all help.

已采纳解答

原帖链接 · pzkpfw · CC BY-SA 4.0

The saying is that you should "trust the error message". It's telling you that net::ERR_CERT_DATE_INVALID which means that somewhere, there's a certificate that it's refusing to use because it either has expired, or is believed to have expired.

  • If it actually has expired, it may be an old leftover certificate from before.
  • If it's only believed to have expired, the time settings on the client making the request is probably wrong.

You can start by checking the expiry of the pem files that the config is told to use:

openssl x509 -enddate -noout -in /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/fullchain.pem
openssl x509 -enddate -noout -in /etc/letsencrypt/live/pvapp-2021.umwelt-campus.de/privkey.pem

If they are fine, check the time settings (and provide output) both on your server and the requesting client with something like timedatectl.

Also, your configuration is not complete: you're doing include /etc/letsencrypt/options-ssl-nginx.conf; but you haven't shown what this file contains. It's quite possible it contains another certificate, loaded after the ones mentioned above, that overrides the settings and loads an old certificate instead.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-03-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。