Skip to content

Add SSLPreferred mode#128

Merged
SeanTAllen merged 1 commit intomainfrom
ssl-preferred
Feb 21, 2026
Merged

Add SSLPreferred mode#128
SeanTAllen merged 1 commit intomainfrom
ssl-preferred

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

Adds SSLPreferred, equivalent to PostgreSQL's sslmode=prefer. Attempts SSL negotiation and falls back to plaintext if the server refuses ('N'). TLS handshake failure is a hard failure — no plaintext fallback.

Implementation adds a _fallback_on_refusal flag to _SessionSSLNegotiating and extracts _start_ssl_negotiation / _proceed_to_connected helpers to share SSL setup code between SSLRequired and SSLPreferred. _CancelSender is updated to fall back to plaintext cancel when using SSLPreferred.

Closes #81

SSLPreferred is equivalent to PostgreSQL's sslmode=prefer: it attempts
SSL negotiation and falls back to plaintext if the server refuses. TLS
handshake failure (server accepts but handshake fails) is a hard failure,
matching PostgreSQL's sslmode=prefer behavior.

Implementation adds a _fallback_on_refusal flag to _SessionSSLNegotiating
and extracts _start_ssl_negotiation / _proceed_to_connected helpers to
share SSL setup code between SSLRequired and SSLPreferred. _CancelSender
is updated to fall back to plaintext cancel when using SSLPreferred.

Closes #81
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 21, 2026
@SeanTAllen SeanTAllen added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Feb 21, 2026
@SeanTAllen SeanTAllen merged commit d0a1230 into main Feb 21, 2026
11 checks passed
@SeanTAllen SeanTAllen deleted the ssl-preferred branch February 21, 2026 12:42
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 21, 2026
github-actions bot pushed a commit that referenced this pull request Feb 21, 2026
github-actions bot pushed a commit that referenced this pull request Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - added Automatically add "Added" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SSLPreferred mode for optional SSL

2 participants