在rails 3.2.11中为控制器添加特定方法后,force_ssl无法正常工作

时间:2013-05-31 10:03:01

标签: ruby-on-rails ruby-on-rails-3

我在用户控制器中添加了force_ssl选项

Class UserController < ApplicationController 
  force_ssl :only => [:login_form, :register]
end

我在Controller中定义了两种方法,我的浏览器将错误显示为

在Chrome中

SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, 
or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error. An error occurred during a 

在Firefox中

connection to localhost:3000.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)

服务器日志正在显示

!! Invalid request

应用程序在开发环境中运行,但不是使用https而是使用http 并在生产中显示以上错误

0 个答案:

没有答案