# cat /etc/letsencrypt/options-ssl-apache.conf
# Baseline setting to Include for SSL sites using Let's Encrypt certificates
SSLEngine on
# Intermediate configuration, tweak to your needs
SSLProtocol -all +TLSv1.1 +TLSv1.2
#SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
SSLCompression off
SSLOptions +StrictRequire
# Add vhost name to log entries
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
CustomLog /var/log/apache2/access.log vhost_combined
LogLevel warn
ErrorLog /var/log/apache2/error.log
# Always ensure Cookies have "Secure" set (JAH 2012/1)
Header edit Set-Cookie (?i)^(.*)(;\s*secure)??((\s*;)?(.*)) "$1; Secure$3$4"
由于我直接在 Apache 中设置了自己的全局 SSL 设置,因此我不希望 Certbot 不包含上述文件和以下行:
Include /etc/letsencrypt/options-ssl-apache.conf
顺便说一句,该行会重复,我在 VirtualHosts 中发现了 3 次...我希望 Certbot 根本不包含该文件。
我该怎么做?
答案1
您将需要使用以下certonly
命令:
身份验证器是与 certonly 命令一起使用来获取证书的插件。身份验证器验证您是否控制要为其请求证书的域,获取指定域的证书,并将证书放置在计算机上的 /etc/letsencrypt 目录中。身份验证器不会安装证书(它不会编辑任何服务器的配置文件来提供所获得的证书)...
用法:
certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...
...
obtain, install, and renew certificates:
(default) run Obtain & install a certificate in your current webserver
certonly Obtain or renew a certificate, but do not install it
例子:
certbot certonly --webroot -w /var/www/example -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net
certbot certonly --standalone -d www.example.com -d example.com