0

出于某种原因,SSL 在主域 www.domainname.com / domainname.com 上运行良好但它不适用于子域(我得到“此连接不受信任”)这是我经历的步骤:

  1. 创建了服务器证书

    openssl req -new -newkey rsa:2048 -nodes -keyout domainname.key -out domainname.csr

  2. 在域名上输入 *.domainname

  3. 将证书内容复制到 SSL 证书供应商

  4. 下载生成的证书
  5. 在 httpd.conf 上

    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"

    ServerName domainname.com

    ServerAlias *.domainname.com

    ServerAdmin admin@domainname.com

    ErrorLog "/opt/bitnami/apache2/logs/https_error_log"

    TransferLog "/opt/bitnami/apache2/logs/https_access_log"

    SSLEngine on

    SSLCertificateFile "/opt/bitnami/apache2/conf/domainname.com.crt"

    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/domainname.key"

    SSLCertificateChainFile "/opt/bitnami/apache2/conf/gd_bundle.crt"

    <FilesMatch "\.(cgi|shtml|phtml|php)$">

        SSLOptions +StdEnvVars

    </FilesMatch>

    <Directory "/opt/bitnami/apache2/cgi-bin">

        SSLOptions +StdEnvVars

    </Directory>

    BrowserMatch "MSIE [2-5]" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0

    CustomLog "/opt/bitnami/apache2/logs/ssl_request_log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost> 

4

0 回答 0