Heroku: SSL is not enabled

2019-03-01 00:14发布

So my Rails (3.2.1) app was working fine on Heroku. Then I set config.force_ssl = true in my production config file, upon opening the file, I now got the "SSL is not enabled" error. I thought Heroku allows you to piggyback their SSL certs, but it is not working for me.

What I've tried:

  • using heroku addons:add piggyback_ssl (fails, as the add-on is now standard..)
  • validating my account (shouldn't be necessary, but I tried it anyway)
  • changing my config.force_ssl = false, but my app still tries to use SSL...

标签: ssl heroku
3条回答
Root(大扎)
2楼-- · 2019-03-01 00:24

Looks like you might have caught Heroku in the middle of a rollout. As of a few weeks ago, Piggyback SSL is now enabled for all users/apps by default. If you're still seeing the "SSL is not enabled" error, you should contact Support.

http://devcenter.heroku.com/changelog/10

查看更多
我命由我不由天
3楼-- · 2019-03-01 00:28

I may a bit late, but the reason that your browser still redirects you to https even if you have that option turned off in Rails has to do with the "Strict-Transport-Security" header (HSTS).

查看更多
迷人小祖宗
4楼-- · 2019-03-01 00:41

Try installing the Piggyback SSL addon as follows:

heroku addons:add ssl:piggyback

Once that's installed and your app has been restarted, it should be accessible at both of the following addresses:

  • http://your-app.heroku.com
  • https://your-app.heroku.com
查看更多
登录 后发表回答