TEST 1 - PostgreSQL with Active Directory authentication
I have installed PotgreSQL Server v15.3 on Red Hat 8.8 and integrate PostgreSQL authentication using Active Directory.
In pg_hba.conf I have set only one settings (all other are commented out):
hostgssenc all all all gss
On separate Red Hat 8.8 machine I have installed PostgreSQL Client v15.3 and I have successfully connected to PostgreSQL server using Kerberos authentication and Active Directory using psql tool as user01.
On separate Windows 2022 Server I have set static IP and DNS address and added computer to Active Directory domain and I can successfully login to Windows with user user01. On this PC I have installed PostgreSQL Client v15.3 and I have tried to connect to PostgreSQL server using psql tool with command:
psql -h server.adexample.com -p 5432 -d postgres
but error is returned:psql: error: connection to server at "server.adexample.com" (192.168.100.36), port 5432 failed: FATAL: no pg_hba.conf entry for host "192.168.100.41", user "user01", database "postgres", no encryption
This is the PROBLEM I am trying to solve.
On Windows where PostgreSQL client v15.3 is installed I monitored network traffic with Wireshark and I see psql client first sends "SSL/TLS" request and server refuses, then sends "clear text" request and server returns error (from step 4). From network packets it looks like psql client does not even tries to connect to server using Kerberos.
TEST 2 - IBM Db2 with Active Directory authentication
- Separate Red Hat 8.8 I have installed IBM Db2 database server v11.5 and configure it to authenticate with Active Directory using Kerberos.
- On separate Red Hat 8.8 I have installed IBM Db2 database client v11.5 and I can successfully connect to Db2 server using Kerberos authentication and Active Directory.
- On the same Windows 2022 Server (that I have already installed PostgreSQL client and Kerberos authentication fails) I have installed IBM Db2 database client v11.5 and I can successfully connect to IBM Db2 database server using Kerberos Active Directory with Windows user 'user01'. I conclude Windows Kerberos is correctly working.
Questions:
- What should I do on PostgreSQL Client on Windows to successfully connect to PostgreSQL Server on Red Hat using Active Directory?
- Is there some setting I additionally have to add to pg_hba.conf on PostgreSQL Server site?
- Does PostgreSQL Client support native Windows Kerberos implementation or do I need to additionally install some software? If yes, which one?
set PGGSSENCMODE=require
and thenpsql -h server.adexample.com -p 5432 -d postgres
and I get error: "gssencmode value "require" invalid when GSSAPI support is not compiled in". Where to download PostgreSQL v15.3 for Windows client with GSSAPI support?