[英]PostgreSQL: Using SSL (Configuration/Certificate Questions) on Windows Server 2019
I am configuring a Windows Server 2019, running PostgreSQL.我正在配置运行 PostgreSQL 的 Windows Server 2019。 There is another server running "Qlik Sense" with a PostgreSQL connection using SSL connecting to the Windows Server.
还有另一台运行“Qlik Sense”的服务器,通过使用 SSL 连接到 Windows Server 的 PostgreSQL 连接。
That does not work, since SSL is not configured correctly I assume.这不起作用,因为我假设 SSL 配置不正确。 Without SSL it does work, the firewall is configured to accept the needed port/ip.
如果没有 SSL,它确实可以工作,防火墙被配置为接受所需的端口/IP。
I have a valid SSL certificate (created by the company) as a .cer file.我有一个有效的 SSL 证书(由公司创建)作为 .cer 文件。 Additionally I converted it as a .pfx file, since I was not sure what I need.
此外,我将其转换为 .pfx 文件,因为我不确定我需要什么。
I is installed in the "Trusted Root Certification Authority Store" as a local certificate.我作为本地证书安装在“受信任的根证书颁发机构商店”中。
Now I figured I need to configure the postgresql.conf and the pg_hba.conf.现在我想我需要配置 postgresql.conf 和 pg_hba.conf。 I enabled "ssl=on".
我启用了“ssl=on”。 In the pg_hba.conf I added:
在 pg_hba.conf 中,我添加了:
"hostssl all 127.0.0.1/32 cert" “hostssl 所有 127.0.0.1/32 证书”
Now I stopped the postgresql service and tried to start it again.现在我停止了 postgresql 服务并尝试再次启动它。 That doesn't work.
那行不通。 If I remove the script changes, it works again.
如果我删除脚本更改,它会再次工作。 Well, I think if it doesn't even work to start the service locally, it won't work remotely ;-)
好吧,我认为如果在本地启动服务甚至不起作用,它也不会远程工作;-)
Does anybody know how to:有谁知道如何:
configure the scripts for postgresql so it used the correct certificate in the windows server trust store?为 postgresql 配置脚本,以便它在 Windows 服务器信任库中使用正确的证书? does that even work?
这甚至有效吗? Maybe I have to put the certificate somewhere and add the path to the config file?
也许我必须将证书放在某处并将路径添加到配置文件?
what certification method to use?使用什么认证方法? "ca" or "fully"?
“ca”还是“完全”?
ok.好的。 it worked.
有效。 i just needed to provide the .cert and .key in the postgresql.conf
我只需要在 postgresql.conf 中提供 .cert 和 .key
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.