2012-07-22 58 views
6

一直在嘗試使用ubuntu 12.0.4中的webrick來創建一個全新的,剛剛創建的rails應用程序來處理ssl。rails 3.2.3無法在https上使用webrick在Ubuntu 12.0.4上工作

已經嘗試了所有我知道的方法。使用config.force_ssl =真application.rb中,也force_ssl應用控制器試過。

對於某些原因,當我使用https:// loacalhost:3000在Firefox,我得到一個錯誤信息說,

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

谷歌瀏覽器的錯誤信息,

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. 

的服務器日誌顯示,

[2012-07-22 16:26:04] ERROR bad URI `�D/i�b���\\��)�F6��ѡ���c���"�\e\x00\x00H\x00��'. 
[2012-07-22 16:26:47] ERROR bad Request-Line `\x16\x03\x01\x00�\x01\x00\x00�\x03\x01P\v�onC��\x1D��\x16\x16R!NU�����\r'�\x05��� 
w��\x00\x00H\x00��'. 

也嘗試在webrick和als的生產模式下運行應用程序o與乘客。沒有幫助。

看起來像是公鑰沒有交付給客戶端。但我可能是錯的。

回答

13

您在開發模式下使用的服務器似乎沒有向客戶端提供SSL證書。

用於開發目的,如果你啓動服務器,使用下面的命令可以用「薄」,因爲它提供了一個SSL證書:

「瘦開始--ssl」 而不是通常的:

「導軌s /導軌服務器」