有沒有辦法將SSL選項傳遞到「rails server」(在Rails 3.0.0上),使用自定義Rack配置或類似的東西?我試圖做兩件事情:如何將SSL選項傳遞到Rails 3.0中的「rails server」?
- 使黃瓜運行涉及安全和非安全網址的測試,並
- 使事情變得簡單了新的開發者,所以他們沒有成立Apache和配置所有的SSL /證書的東西,甚至可以寫一行代碼。
在2.3.8上我們有一個分叉的腳本/服務器,它可以在第二個端口上啓動一個特殊的WEBrick,並帶有所有適當的SSL選項。當我嘗試升級到Rails 3時,當然會爆炸,所以我試圖弄清楚如何解決這個問題,理想的做法是不需要分叉任何東西。
在我們的分叉腳本/服務器我們設置選項如下所示:
:SSLEnable => true,
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.open(current_dir + "/config/certs/server.key").read),
:SSLCertificate => OpenSSL::X509::Certificate.new(File.open(current_dir + "/config/certs/server.crt").read),
:SSLCertName => [ [ "CN", WEBrick::Utils::getservername ] ]
,但我不知道該怎麼做,在新的框架。
感謝您的幫助!