![我的 SSL 配置不起作用。Ubuntu apache 2.4](https://linux22.com/image/680476/%E6%88%91%E7%9A%84%20SSL%20%E9%85%8D%E7%BD%AE%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82Ubuntu%20apache%202.4.png)
我的 SSL 配置现在不起作用。我刚刚从一个主机移动了一个站点(我移动了证书文件。
当我尝试访问时出现此错误。(Chrome 和 Firefox 告诉我 SSL 协议无效)
已解决:最后我忘记启用该网站了:(抱歉,感谢您对 SSL 配置的帮助。
我在我的 apache 日志中看到了这个(我想那是在我输入 usin my http 路由的时候)
[09/Apr/2016:16:54:05 +0000] "GET /homepage/ HTTP/1.1" 302 560 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36"
这是我的SSL虚拟主机文件站点启用(我将网站名称替换为我的网站):
根据回复进行编辑: - 注释了 SSLCertificateChainFile 行。
来自 ssl 虚拟主机的 ErrorLog 更改为 /home/my-site/logs/my-site.com-error-ssl.log
LogLevel 设置为调试
CustomLog 从 ssl virtualhost 更改为 /home/my-site/logs/my-site.com.com-access-ssl.log 合并
新的日志文件丢失了,我真的看不到任何 ssl 错误。 我也测试了 ssl 模块是否已启用
非SSL
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName my-site.com
ServerAlias www.my-site.com
DocumentRoot /home/my-site/www/my-site.com/current/public/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/my-site/www/my-site.com/current/public/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog /home/my-site/logs/my-site.com-error.log
LogLevel warn
CustomLog /home/my-site/logs/my-site.com.com-access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Require all denied
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
SSL
<IfModule mod_ssl.c>
服务器管理员[电子邮件保护] 服务器名称 my-site.com 服务器别名 www.my-site.com 文档根目录 /home/my-site/www/my-site.com/current/public
<Directory /home/my-site/www/my-site.com/current/public >
Allow from All
Require all granted
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /home/my-site/logs/my-site.com-error-ssl.log
LogLevel debug
CustomLog /home/my-site/logs/my-site.com.com-access-ssl.log combined
SSLEngine on
SSLCertificateFile /home/my-site/www/my-site.com/current/ssl/www.my-site.com.crt
SSLCertificateKeyFile /home/my-site/www/my-site.com/current/ssl/www.my-site.com.key
#SSLCertificateChainFile /home/my-site/www/my-site.com/current/ssl/my-site.com.crt
SSLCACertificateFile /home/my-site/www/my-site.com/current/ssl/my-site.com.crt
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
答案1
您将在日志中看到更多带有调试级别警告的内容
LogLevel debug
您在这里定义了两次 CA 证书:
SSLCertificateChainFile /home/my-site/www/my-site.com/current/ssl/sf_bundle_my-site.com.crt
SSLCACertificateFile /home/my-site/www/my-site.com/current/ssl/sf_bundle_my-site.com.crt
链式证书文件可以包含根证书颁发者、中间受信任颁发者和您的证书。由于您单独引用的是您自己的证书,因此 CA 证书在这里应该足够了。
尝试注释掉 SSLCertificateChainFile 行。
并将你的 https url 放入在线检查器中,以获得更好的错误报告