如何以编程方式使用certbot启用/禁用SSL

时间:2018-09-18 08:15:12

标签: javascript node.js ssl nginx certbot

所以我正在使用nodejs和nginx,我想以编程方式与之一起使用certbot,并能够从exec()获取输出。

此命令应在没有用户交互的情况下生成证书:

certbot certonly --standalone --agree-tos -m my@email.com -d mydomain.com

但是我收到了很多文本,我只需要证书的路径和到期日期。

有没有办法以像json这样的nodejs友好格式来获取它?

1 个答案:

答案 0 :(得分:1)

看着那个人:https://certbot.eff.org/docs/man/certbot.html

使用标志-n Run non-interactively

您可以使用标志nginx来自动执行安装。 --nginx Obtain and install certificates using Nginx (default: False)

最后: certbot --agree-tos -n --nginx -d example.com -d www.example.com -m hello@mail.com