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, 09 Sep 2026 15:45:36 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc3970363257@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/ConnectionFactoryImpl.java:427)
The `URISyntaxException` path lands in the same message, so a user whose issuer will not parse is told to set `oauthAllowInsecureIssuer=true`, which does not fix a malformed URL. `ValidateOAuthIssuerTest.malformedIssuerRejected` pins that behavior with `ht!tp://bad url`.
Splitting the two causes gives each its own remedy:
```java
} catch (URISyntaxException e) {
throw new PSQLException(
GT.tr("oauthIssuer is not a valid URL: {0}", issuer),
PSQLState.INVALID_PARAMETER_VALUE, e);
}
```
A URI with no scheme at all, such as `issuer.example.com`, reaches the HTTPS message through `getScheme() == null` rather than through a scheme comparison, and is worth a case in the test either way.