简体   繁体   English

PostgreSQL:在 Windows Server 2019 上使用 SSL(配置/证书问题)

[英]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.

相关问题 postgresql、c# 和 windows server 2019 的问题 - Problems with postgresql, c# and windows server 2019 Windows 服务器操作系统 2019 中 PostgreSQL 的 repmgr 的解决方法 - Workaround for repmgr of PostgreSQL in Windows Server OS 2019 PostgreSQL Windows Server SSL压缩不起作用 - Postgresql windows server ssl compression not working Jetty + HikariCP + JVM SSL 连接问题到具有 RDS 2019 CA 根证书的 RDS PostgreSQL - Jetty + HikariCP + JVM SSL Connectivity Issues to RDS PostgreSQL with RDS 2019 CA root certificate PostgreSQL SSL 配置 - PostgreSQL SSL Configuration 使用SSL连接到postgresql国外服务器出错 - Error connecting to postgresql foreign server using SSL Rstudio无法连接到Windows计算机上启用SSL的Postgresql服务器 - Rstudio fails to connect to SSL enabled postgresql server on windows machine 使用Postgresql作为应用程序服务器(Windows Server) - Using Postgresql as application server ( windows server ) 从 Digital Ocean 下载的 .crt CA 证书文件放在哪里,用于连接到其托管 PostgreSQL 服务器的 SSL - Where to put the .crt CA certificate file downloaded from Digital Ocean for a SSL connection to their Managed PostgreSQL server 在Rails应用程序中为PostgreSQL提供SSL证书 - Provide SSL certificate to PostgreSQL in a Rails app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM