From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4251: OAuth implementation
Date: Wed, 23 Sep 2026 06:43:33 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc4079734570@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/OAuthAuthenticator.java:66)
This trusts the value of `sslmode`, not what happened on the socket:
- `sslmode=verify-full&sslfactory=org.postgresql.ssl.NonValidatingFactory` connects with no root certificate, and the token goes to an unverified server without any warning. The docs describe this, but a user who copies a `NonValidatingFactory` URL from a Stack Overflow answer won't read that paragraph.
- The Cloud SQL and AlloyDB Java connectors require `sslmode=disable`, and their `socketFactory` returns an `SSLSocket` they have already verified. This check refuses them with `sslmode=disable does not verify it`, which is wrong for them.
- `verify-ca` passes although it skips the host name check.
libpq has no transport check for OAUTHBEARER at all. Being stricter is defensible for a bearer token, but these cases need to be either handled or documented as known limits.