Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbXeJ-002eMH-2A for pgsql-general@arkaria.postgresql.org; Mon, 22 Jun 2026 05:56:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbXeI-004dU4-1R for pgsql-general@arkaria.postgresql.org; Mon, 22 Jun 2026 05:56:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbXeI-004dTw-0G for pgsql-general@lists.postgresql.org; Mon, 22 Jun 2026 05:56:46 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wbXeG-00000001Xij-0gzl for pgsql-general@lists.postgresql.org; Mon, 22 Jun 2026 05:56:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unixarea.de ; s=blu3434000; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Reply-To:Message-ID:Subject:To:From:Date:Sender:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=XBFM7mcbLz0ZI0wioCHz4ap9bEzgZOtsGQY5KeyC9ao=; b=T7K3PpZ4IcaI0htblpHcOP9FPh zQncB5aycZXKqIB/31ryoCNHQ3lZXS16K51YcT9m9FRgZOtOSHgI2cf9wtUNQftoIIZi4suSdTZ8x SKFTARSqAk84OMBwbdSy1yFjgkXm7Wk14dxwNizFNG2DwtiujW2Z04LljZxFsexThFQExrgdZAlVr bIMNZfo49YPjEvWZ5xk1HVEYh7MLeKf78bojJ8NomHk28ga6x34Cx1JyuMRYHi9lTgjWy9L2zDKdS c70IZ5z/z51RP9UDpSm0HT+QCh63B8V7rbbyytKoBIdCBITcfmkGoJ3GaDLUKiyRxkzJdMCNgff6A EApdH0ww==; Received: from [62.216.207.221] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wbXeB-006i5O-SJ; Mon, 22 Jun 2026 07:56:39 +0200 Received: from localhost.my.domain (c720-1400094 [127.0.0.1]) by localhost.unixarea.de (8.17.1/8.14.9) with ESMTP id 65M5udsk001434; Mon, 22 Jun 2026 07:56:39 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.17.1/8.14.9/Submit) id 65M5udjm001433; Mon, 22 Jun 2026 07:56:39 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Mon, 22 Jun 2026 07:56:39 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: PostgreSQL server with SSL Message-ID: Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 14.0-CURRENT r1400094 (amd64) X-message-flag: Mails in HTML will not be read! Please, only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 62.216.207.221 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I've enabled SSL in the connection to the PostgreSQL server (16.5). All details see below. The SSL connection works fine from a remote host, for example from my MacBook, but does not work on the host itself via interface 'lo' where it gives the error message: FATAL: no PostgreSQL user name specified in startup packet connection to server at "srap48dxr1.dev.xxxx.org" (10.23.33.57), port 5432 failed: FATAL: no PostgreSQL user name specified in startup packet and psql crashes. Interesting observation with tcpdump is, stat the above error message is sent in clear over the network. The same picture is with all C- or Java-written software using an ESQL/C or JDBC interface. Any idea on this? Here are the details # su - postgres $ mkdir ca $ cd ca $ export LD_LIBRARY_PATH=/usr/local/sisis-pap/lib $ export OPENSSL=/usr/local/sisis-pap/bin/openssl $ $OPENSSL version # just for testing export OPENSSL_CONFIG='-config /usr/local/sisis-pap/openssl.cnf' $ /usr/local/sisis-pap/misc/CA.pl -newca ... $ /usr/local/sisis-pap/misc/CA.pl -newreq ... $ ls -l newreq.pem newkey.pem -rw------- 1 postgres postgres 1886 16. Jun 12:40 newkey.pem -rw-r--r-- 1 postgres postgres 1090 16. Jun 12:42 newreq.pem $ /usr/local/sisis-pap/misc/CA.pl -sign ... $ mv newcert.pem pg-server.crt $ mv newkey.pem pg-server.key we must remove the passphrase from the key for PostgreSQL to be able to read and start the PostgreSQL server without user interaction: $ $OPENSSL rsa -in pg-server.key -out pg-passless-server.key Enter pass phrase for pg-server.key: writing RSA key Enabling SSL in postgresql.conf: $ vim /data/postgresql165/data/postgresql.conf # - SSL - ssl = on ssl_cert_file = '/home/postgres/ca/pg-server.crt' ssl_key_file = '/home/postgres/ca/pg-passless-server.key' ssl_ca_file = '/home/postgres/ca/demoCA/cacert.pem' $ vim /data/postgresql165/data/pg_hba.conf changed 'host' to 'hostssl' for the relevant lines Start of the server: # /etc/init.d/postgres165 start Connect from my MacBook to the remote host srap48dxr1.dev.xxxx.org: $ export PGHOST=srap48dxr1.dev.xxxx.org $ export PGPORT=5432 $ psql -Usisis sisis Password for user sisis: psql (14.15 (Homebrew), server 16.5) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. sisis=> Connect on the host itself: $ export PGHOST=srap48dxr1.dev.xxxx.org $ export PGPORT=5432 $ /usr/local/sisis-pap/pgsql-16.5/bin/psql -Usisis psql: Fehler: connection to server at "srap48dxr1.dev.xxxx.org" (10.23.33.57), port 5432 failed: FATAL: no PostgreSQL user name specified in startup packet connection to server at "srap48dxr1.dev.xxxx.org" (10.23.33.57), port 5432 failed: FATAL: no PostgreSQL user name specified in startup packet free(): invalid pointer Abgebrochen (Speicherabzug geschrieben) $ ldd /usr/local/sisis-pap/pgsql-16.5/bin/psql | egrep 'libssl|crypto' libssl.so.3 => /usr/local/sisis-pap/lib/libssl.so.3 (0x00007f9ea38cb000) libcrypto.so.3 => /usr/local/sisis-pap/lib/libcrypto.so.3 (0x00007f9ea3000000) -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub