在 Fedora 22 上使用 SSL 超时
Posted
技术标签:
【中文标题】在 Fedora 22 上使用 SSL 超时【英文标题】:Time Out using SSL on Fedora 22 【发布时间】:2016-07-03 00:00:47 【问题描述】:自从我将 Fedora 14 升级到 22 后,当我尝试在服务器上打开 https 页面时,我一直收到 ERR_CONNECTION_TIMED_OUT。 服务器在 linode 云上运行,并添加了一个“A/AAAA 记录”,如下所示:
HOSTNAME ssl_page.mysite.com
IP ADDRESS xxx.xxx.xxx.xxx
TTL Default
我的 vhost.conf 如下所示:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/html/mysite
ErrorLog /var/www/html/mysite/logs/error.log
CustomLog /var/www/html/mysite/logs/access.log combined
</VirtualHost>
我的 ssl.conf 看起来像:
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
<VirtualHost _default_:443>
DocumentRoot "/var/www/html/ssl_page"
ServerName ssl_page.mysite.com:443
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite PROFILE=SYSTEM
SSLCertificateFile /etc/pki/tls/certs/ssl_page.mysite.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/ssl_page.mysite.com.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %SSL_PROTOCOLx %SSL_CIPHERx \"%r\" %b"
</VirtualHost>
“/var/log/http/ssl_error”或“/var/www/http/ssl_page/logs/error.log”都没有针对此问题的消息。
我什至尝试禁用firewalld,但也没有用。
有人知道发生了什么吗?
【问题讨论】:
【参考方案1】:终于成功了,我只需要以这种方式更改我的 ssl.conf:
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
<VirtualHost *:80>
ServerName ssl_page.mysite.com
DocumentRoot /var/www/html/ssl_page
Redirect permanent / https://ssl_page.mysite.com
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot "/var/www/html/ssl_page"
ServerName ssl_page.mysite.com:443
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite PROFILE=SYSTEM
SSLCertificateFile /etc/pki/tls/certs/ssl_page.mysite.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/ssl_page.mysite.com.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
"%t %h %SSL_PROTOCOLx %SSL_CIPHERx \"%r\" %b"
</VirtualHost>
缺少的是重定向指令。
谢谢各位大佬!!!
【讨论】:
以上是关于在 Fedora 22 上使用 SSL 超时的主要内容,如果未能解决你的问题,请参考以下文章