【发布时间】:2011-01-19 22:34:27
【问题描述】:
试图让我的 Rails 应用使用 SSL 提交一些敏感的表单数据,但运气不佳。基本问题是,一旦我提交了一个表单(这是一个 POST 请求),它只会挂起一分钟,然后说服务器没有响应。
这是我正在使用的:
Apache 2.2.3 导轨 2.3.8 RedHat Linux(机架空间服务器)
使用 ssl_requirement 插件如下:
应用控制器:
class ApplicationController < ActionController::Base
include SslRequirement
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
filter_parameter_logging :password
end
控制器我想在一个动作上使用 SSL:
class RegistrationsController < ApplicationController
ssl_required :create
...
end
我的 httpd.conf 包含这一行来抓取 ssl.conf:
Include conf.d/*.conf
我的 SSL VHost(在 conf.d/ssl.conf 文件中)如下所示:
<VirtualHost XXX.XXX.XXX.XXX:443>
ServerName www.nameofmyapp.com
ServerAlias nameofmyapp.com
DocumentRoot /var/www/apps/myapp/current/public
RailsEnv production
RequestHeader set X_FORWARDED_PROTO 'https'
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/2012-nameofmyapp.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/2012-nameofmyapp.com.key
SSLCACertificateFile /etc/pki/tls/certs/SecureSite_Bundle.pem
</VirtualHost>
【问题讨论】:
-
RSA 服务器证书 CommonName (CN) `localhost.localdomain' 与服务器名称不匹配!?
标签: ruby-on-rails apache ssl https