Jor*_*ger 16 ssl-certificate apache-2.2
Apache 2.2.3/mod_ssl/CentOS 5.5 VPS
我们的证书已于 2011 年 10 月 6 日过期,即使我们看似正确安装了新证书,浏览该站点仍然显示证书已过期!我尝试删除浏览器缓存并使用几种不同的浏览器。ssl.conf 文件中的相关行(我已经排除了那些被注释掉的行):
Listen 127.0.0.1:443
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
# Note - I tried disabling SSLSessionCache with the "none" setting but it didn't help.
<VirtualHost 127.0.0.1:443>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /var/certs/gentlemanjoe.com/new2011/gentlemanjoe.com.crt
SSLCertificateKeyFile /var/certs/gentlemanjoe.com/new2011/gentlemanjoe.com.key
SSLCertificateChainFile /var/certs/gentlemanjoe.com/new2011/gd_bundle.crt
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
ServerAdmin webmaster@donotemailme.com
DocumentRoot /var/www/gentlemanjoe.com
ServerName gentlemanjoe.com
<Directory /var/www/gentlemanjoe.com>
AllowOverride All
Order deny,allow
allow from all
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我检查过的东西
首先,我尝试将旧的证书和密钥文件移动到一个完全不同的文件夹,以确保 Apache 仍然不会以某种方式抓取它们。没有改变。为了好玩,我尝试临时重命名新的证书和密钥文件,Apache 尽职尽责地抱怨并拒绝启动。
然后我试图确保我没有被编辑错误的配置文件所愚弄。使用“locate”,我在/etc/httpd/conf/httpd.conf 下只找到了一个httpd.conf 文件。我还使用“定位”来验证只有一个 ssl.conf 文件,/etc/httpd/conf.d/ssl.conf。密钥文件是我使用 OpenSSL 生成的,遵循 GoDaddy 为生成 CSR 提供的说明。
我已经通过将 test.html 文件上传到 /var/www/gentlemanjoe.com 文件夹并验证我可以浏览到它来验证我正在使用正确的站点。但是,如果我尝试在 HTTPS 中查看测试文件,则会收到相同的证书过期警告。
我确认证书本身具有正确的到期日期:
openssl x509 -in /var/certs/gentlemanjoe.com/new2011/gentlemanjoe.com.crt -noout -text
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
07:e7:49:69:97:96:16
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certificates.godaddy.com/repository, CN=Go Daddy Secure Certification Authority/serialNumber=07969287
Validity
Not Before: Oct 21 17:37:55 2011 GMT
Not After : Oct 8 21:16:03 2013 GMT
Subject: C=CA, ST=BC, L=Burnaby, O=Diamond Bailey Consolidated Commercial Services Ltd, OU= , CN=www.gentlemanjoe.com
Run Code Online (Sandbox Code Playgroud)
我尝试使用新的 CSR 在 GoDaddy 重新键入证书,一切似乎都有效,但我在浏览器中得到了相同的结果。
可能的线索 #1
每当我执行“apachectl restart”时,我都会在 error_log 文件中看到:
[Fri Oct 21 18:03:33 2011] [notice] SIGHUP received. Attempting to restart
[Fri Oct 21 18:03:33 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 21 18:03:33 2011] [notice] Digest: done
[Fri Oct 21 18:03:33 2011] [info] APR LDAP: Built with OpenLDAP LDAP SDK
[Fri Oct 21 18:03:33 2011] [info] LDAP: SSL support available
[Fri Oct 21 18:03:33 2011] [info] Init: Seeding PRNG with 256 bytes of entropy
[Fri Oct 21 18:03:33 2011] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Fri Oct 21 18:03:33 2011] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Fri Oct 21 18:03:33 2011] [info] Shared memory session cache initialised
[Fri Oct 21 18:03:33 2011] [info] Init: Initializing (virtual) servers for SSL
[Fri Oct 21 18:03:33 2011] [warn] RSA server certificate CommonName (CN) `www.gentlemanjoe.com' does NOT match server name!?
[Fri Oct 21 18:03:33 2011] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5
[Fri Oct 21 18:03:34 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 21 18:03:34 2011] [info] Server built: Aug 30 2010 12:28:40
Run Code Online (Sandbox Code Playgroud)
GoDaddy 技术人员告诉我 www 与非 www 应该无关紧要,我倾向于同意,因为浏览器中的安全警告不是抱怨服务器名称不匹配,而是过期,表明旧证书仍然存在以某种方式加载。
可能的线索#2
http://gentlemanjoe.com的 HTTP 服务器响应头显示“Andromeda”而不是“Apache”。这对我来说似乎很奇怪,因为我对“仙女座”的谷歌搜索发现了一个媒体服务器类型的项目,该项目不会安装在这台服务器上(但我不能肯定地说,因为我没有设置任何这些,通常的管理员/开发人员正在休假,我只是在帮助一个朋友使用他的网站。)此外,httpd.conf 文件不包含字符串“Andromeda”,表明它没有被修改为吐出这个。所以这可能是他使用的 Magento 电子商务平台,但是替换标准的 Apache 响应头有什么意义呢?
Sha*_*den 18
Apache 面前有东西。查看该配置:
Listen 127.0.0.1:443
....
<VirtualHost 127.0.0.1:443>
Run Code Online (Sandbox Code Playgroud)
它仅在 localhost 上侦听,因此 Internet 客户端不会直接访问此服务 - 他们可能会被代理。
为了检查 Apache 是否加载了正确的证书,请直接在 Apache 的侦听器上点击该服务: openssl s_client -connect 127.0.0.1:443 -showcerts
不确定仙女座标头,所以,让我们找到进程:lsof -i.
Apache 将拥有127.0.0.1:443,而其他一些服务拥有0.0.0.0:443(或 VPS 的公共地址:443)——那就是需要新证书的服务。