如何在Phoenix框架中连接Heroku时设置SSL选项?

unftdfkk  于 4个月前  发布在  Phoenix
关注(0)|答案(1)|浏览(53)

我最近把Phoenix升级到了最新的版本(1.7.7),Ecto也升级到了3.10.3。在升级之前,连接Heroku pg的时候,我只设置了SSL: true,连接就可以了:

config :abc, abc.Repo,
  url: System.get_env("DATABASE_URL"),
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
  ssl: true

字符串
升级后,它失败并显示以下消息:

[error] Postgrex.Protocol (#PID<0.2449.0>) failed to connect: ** (DBConnection.ConnectionError) ssl connect: Options (or their values) can not be combined: [{verify,verify_peer},
                                                {cacerts,undefined}] - {:options, :incompatible, [verify: :verify_peer, cacerts: :undefined]}


现在似乎需要更多的选项。有很多选项,我找不到一些关于如何设置它们的例子。顺便说一下,Heroku pg强制设置SSL选项,所以我不能删除它。有人遇到同样的问题吗?

相关问题