在哪里为 Openshift 上的安全 postgresql 连接加载证书?

Where to load certificates for secured postgresql connections on Openshift?

根据此 issue 的解决方案,我尝试在 Openshift 中设置从 node.js 应用程序到 postgresql 9.2 数据库的安全连接。

连接 rhc ssh --app ligatures 后,我尝试使用 find . -name 'postgresql.conf' 查找 postgresql.conf 文件,但 returns 什么也找不到。

我可以找到两个 /data 目录:

./app_root/data
./app_root/runtime/data

两个目录都包含一个 postgresql-9.2.tar.gz 文件,但没有其他文件。

  1. 我应该在哪里 load/generate 需要的证书文件 secured 个连接?
  2. 设置环境变量如OPENSHIFT_POSTGRESQL_SSL_ENABLED后如何验证postgresql.conf的内容?

更新

我进行了以下测试:

  1. 我已使用可用的说明 here.
  2. 在我的应用程序的 ./app_root/data 目录中创建了适当的证书
  3. 我设置了OPENSHIFT_POSTGRESQL_SSL_ENABLED=true
  4. 我尝试使用 PgAdmin III 连接到数据库。
  5. 我得到了一个 Error connecting to the server: server does not support SSL, but SSL was required

我在 RedHat bugzilla 上开了一个 issue

更新二

上面打开的问题的解决方案仅在应用程序创建为不可扩展时才有效。我已经为可扩展的应用程序打开了一个额外的 issue

根据docs you're referring to $PGDATA which in case of OpenShift is postgresql/data. The problem you've also mentioned is related to that file location, if you enable SSL for postgresql, it checks for those cert files in $PGDATA if none is found server won't start, and that's the problem you described in the 2nd part of your question. I've fixed that by adding additional check which will turn SSL on only if $PGDATA/server.crt and $PGDATA/server.key exists, see here. More info is in the bug你创建的。