VPS侦探论坛

 找回密码
 注册
查看: 2071|回复: 5

1.9使用lnmp vhost add 添加新域名,nginx提示证书地址不正确 _ecc

[复制链接]
发表于 2023-2-4 14:27:10 | 显示全部楼层 |阅读模式

查看nginx配置的vhost目录下的文件/usr/local/nginx/conf/vhost/www.domain.com.conf

             发现证书地址写的是  /usr/local/nginx/conf/ssl/www.domain.com/fullchain.ce
但是新增的时候提示的地址是  /usr/local/nginx/conf/ssl/www.domain_ecc.com/fullchain.ce
以前都可以正常增加,最近使用lnmp vhost add就会出现这个情况

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2023-2-5 11:49:41 | 显示全部楼层


这个貌似是acme.sh 升级了默认使用ecc证书导致的,可以编辑一下 /bin/lnmp 查找  --issue ${letsdomain} -w ${vhostdir} 替换为 --issue ${letsdomain} -w ${vhostdir} -k 2048 注意,这个前后都有空格,所有匹配的都替换掉
然后 rm -rf /usr/local/nginx/conf/ssl/www.domain.com_ecc/ 并将  /usr/local/nginx/conf/vhost/www.domain.com.conf 中的ssl站点的整个server段删除,然后重新 lnmp ssl add 进行添加


也可以修改 /usr/local/acme.sh/acme.sh 查找

DEFAULT_ACCOUNT_KEY_LENGTH=ec-256
DEFAULT_DOMAIN_KEY_LENGTH=ec-256

将后面的ec-256都更改为2048 保存,然后再 rm -rf /usr/local/nginx/conf/ssl/www.domain.com_ecc/ 并将  /usr/local/nginx/conf/vhost/www.domain.com.conf 中的ssl站点的整个server段删除,然后重新 lnmp ssl add 进行添加
但是这样每次acme.sh升级了都需要再修改一下ec-256



update:
我这边写了个修复脚本,可以执行 bash <(curl -s http://soft.vpser.net/lnmp/ext/fix_ssl_20230205.sh) 修复一下,再按上面第二步的步骤删除并重新添加生成ssl
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2023-2-4 14:30:04 | 显示全部楼层

本帖最后由 bobobo 于 2023-2-4 14:38 编辑

[Sat 04 Feb 2023 02:05:39 PM CST] Your cert is in: /usr/local/nginx/conf/ssl/www.domain.com_ecc/www.domain.com.cer
[Sat 04 Feb 2023 02:05:39 PM CST] Your cert key is in: /usr/local/nginx/conf/ssl/www.domain.com_ecc/www.domain.com.key
[Sat 04 Feb 2023 02:05:39 PM CST] The intermediate CA cert is in: /usr/local/nginx/conf/ssl/www.domain.com_ecc/ca.cer
[Sat 04 Feb 2023 02:05:39 PM CST] And the full chain certs is there: /usr/local/nginx/conf/ssl/www.domain.com_ecc/fullchain.cer
[Sat 04 Feb 2023 02:05:39 PM CST] Run reload cmd: /etc/init.d/nginx reload
Reload nginx...  done
[Sat 04 Feb 2023 02:05:39 PM CST] Reload success
Test Nginx configure file......
nginx: [emerg] cannot load certificate "/usr/local/nginx/conf/ssl/www.domain.com/fullchain.cer": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/ssl/www.domain.com/fullchain.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Reload Nginx......
nginx: [emerg] cannot load certificate "/usr/local/nginx/conf/ssl/www.domain.com/fullchain.cer": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/ssl/www.domain.com/fullchain.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)


美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2023-2-5 14:25:06 | 显示全部楼层



licess 发表于 2023-2-5 11:49
这个貌似是acme.sh 升级了默认使用ecc证书导致的,可以编辑一下 /bin/lnmp 查找  --issue ${letsdomain} -w ...

已经使用修复脚本。
这个问题很奇怪,我重装后第一次使用lnmp vhost add是没有这个ecc后缀的。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2023-2-5 17:05:18 | 显示全部楼层

bobobo 发表于 2023-2-5 14:25
已经使用修复脚本。
这个问题很奇怪,我重装后第一次使用lnmp vhost add是没有这个ecc后缀的。 ...

重装后是下载的是老版本acme.sh,已有的机器acme.sh是会定期升级的,升级之后就是新版的了

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-20 03:26 , Processed in 0.028669 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表