Visitar URL original
fix: retry with SSL on IOException when sslMode=ALLOW by vlsi · Pull Request #3973 · pgjdbc/pgjdbc · GitHub
Skip to content

fix: retry with SSL on IOException when sslMode=ALLOW - #3973

Merged
vlsi merged 1 commit into
pgjdbc:masterfrom
vlsi:retry_sslmodeallow
Mar 18, 2026
Merged

vlsi merged 1 commit into
pgjdbc:masterfrom
vlsi:retry_sslmodeallow

Conversation

@vlsi

@vlsi vlsi commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

When sslMode=ALLOW, the driver tries plaintext first and upgrades to SSL if the server rejects the connection. On Windows, PostgreSQL may reset the connection (IOException) instead of sending a FATAL auth error (SQLException with INVALID_AUTHORIZATION_SPECIFICATION). This caused the ALLOW flow to fail instead of upgrading to SSL.

Extract tryConnectWithSsl helper (mirrors tryConnectWithoutSsl) and handle IOException for ALLOW in the same catch block as PREFER.

When sslMode=ALLOW, the driver tries plaintext first and upgrades to
SSL if the server rejects the connection. On Windows, PostgreSQL may
reset the connection (IOException) instead of sending a FATAL auth
error (SQLException with INVALID_AUTHORIZATION_SPECIFICATION). This
caused the ALLOW flow to fail instead of upgrading to SSL.

Extract tryConnectWithSsl helper (mirrors tryConnectWithoutSsl) and
handle IOException for ALLOW in the same catch block as PREFER.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vlsi vlsi added the bug label Mar 17, 2026
@vlsi
vlsi merged commit 5b0f852 into pgjdbc:master Mar 18, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant