【问题标题】:Lets Encrypt subdomain not secure让加密子域不安全
【发布时间】:2020-01-22 07:36:27
【问题描述】:

我的域(domain.com 和 www.domain.com)有一个 LetsEncrypt SSL 证书。现在,我想将 workflow.domain.com 添加到证书中。我尝试通过以下命令使用 certbot 的扩展选项:

certbot -d domain.com -d www.domain.com -d workflow.domain.com --expand

Certbot 返回成功响应。但是,浏览器仍然显示不安全...

所以,我已经吊销了我的证书以开始清理。

我使用certbot --apache 运行了 certbot。它正确显示了我的 3 个选项,因此我选择了所有 3 个选项以包含在证书中。

尽管浏览器在workflow.domain.com 上一直显示我不安全,但 certbot 没有错误地返回?

certbot certificates的输出如下图:

Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Found the following certs:
  Certificate Name: domain.com
    Domains: domain.com workflow.domain.com www.domain.com
    Expiry Date: 2019-12-20 15:05:24+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/domain.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/domain.com/privkey.pem
-------------------------------------------------------------------------------

注意,其他 2 个域(domain.com 和 www.domain.com)显示为安全

子域的虚拟主机配置如下所示:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName workflow.domain.com

        serverAdmin info@domain.com
        DocumentRoot /var/www/Domain/Workflow

        <Directory /var/www/Domain/Workflow>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

AddType application/x-font-ttf                  ttc ttf
AddType application/x-font-otf                  otf
AddType application/font-woff                   woff
AddType application/font-woff2                  woff2
AddType application/vnd.ms-fontobject           eot
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

# RewriteCond %{SERVER_NAME} =domain.com [OR]
# RewriteCond %{SERVER_NAME} =www.domain.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
</VirtualHost>
</IfModule>

【问题讨论】:

  • 域不安全的消息是什么,告诉您问题的原因?是因为名字不匹配,还是其他原因?
  • 您迟早会在单击损坏的挂锁后获得的菜单中找到类似查看证书的内容。
  • 您能看看与新子域关联的网络服务器配置吗?似乎 certbot 没有以某种方式获取虚拟主机...
  • 似乎由于某种原因 apache 没有获取证书,您能否编辑问题以包含相关的虚拟主机配置。
  • 还有一些在线 ssl 检查器,您可以试一试并告诉我们它对问题的看法吗?

标签: certbot


【解决方案1】:

问题原来是缺少重定向到 https。重写代码在子域上注释。您可以将这些行添加到您的虚拟主机配置中:

RewriteCond %{SERVER_NAME} = workflow.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

请考虑编辑问题,以反映实际问题。

【讨论】:

    【解决方案2】:

    我只需要将这个标志添加到我的 docker-compose.yml 文件中的 certbot 服务中:(--expand -d someone.me,www.someone.me,bo.someone.me

    command: certonly --webroot --webroot-path=/var/www/html --email someone.someone@gmail.com --agree-tos --no-eff-email --force-renewal --expand -d someone.me,www.someone.me,bo.someone.me
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-29
      • 1970-01-01
      • 2012-02-28
      • 2012-11-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多