所以我正在使用 nodejs 和 nginx,我想以编程方式使用 certbot 并能够从 exec() 获取输出。
这个命令应该在没有用户交互的情况下生成证书:
certbot certonly --standalone --agree-tos -m my@email.com -d mydomain.com
但我收到很多文本,我只需要证书的路径和到期日期。
有没有办法以 nodejs 友好的格式获取它,比如 json?
最佳答案
看着男人:https://certbot.eff.org/docs/man/certbot.html
使用标志 -n 以非交互方式运行
您可以使用标志 nginx
来为此自动安装。
--nginx 使用 Nginx 获取和安装证书(默认:False)
最后:
certbot --agree-tos -n --nginx -d example.com -d www.example.com -m hello@mail.com
关于javascript - 如何以编程方式使用 certbot 启用/禁用 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52381963/