在Windows Server 2012的postgresql.conf中更改ssl = on后,我无法运行postgresql服务器。



在postgresql.conf中更改ssl=后,postgresql服务器无法再运行。启用SSL还需要哪些设置。我在WindowsServer2012上使用postgresql。

这是我的研究https://www.postgresql.org/docs/current/static/ssl-tcp.html#SSL-存档

在链接中,您需要首先创建一个自签名证书。

要做到这一点,您需要OPENSSL。我使用的是apache2.4.12,它有1.01.1万版本的OpenSSL

您也可以从互联网上轻松下载和安装。

然后转到Openssl从cmd安装的文件夹。在我的例子中,"cd C:\Program Files\Apache Software Foundation\Apache 24\bin"。

然后执行上面链接中所说的命令。

openssl req-new-text-out server.req

openssl rsa-in-privkey.pem-out server.key

openssl req-x509-in-server.req-text-key server.key-out server.crt(在Windows操作系统中,您只能执行这些步骤。)

然后复制server.key C:\(任意位置)

复制服务器.crt C:\

查找您复制的文件(server.key&server.crt),并将它们复制到PostgreSQL数据文件夹中。

然后在postgresql.conf文件中更改ssl=on。

重新启动postgresql服务。

完成!!!

最新更新