model-writtenrun 3337 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Michael Paquier opened the thread by proposing HBA controls for direct versus traditional SSL negotiation, allowing administrators to enforce or disable either form #1.
- Heikki Linnakangas questioned the security benefit and noted that HBA rejection occurs too late to control the initial handshake, while Jacob Champion argued that eliminating plaintext negotiation reduces attack surface #2 #3; HBA controls were deferred beyond PostgreSQL 17, and Robert Haas likewise treated a server-wide control as a separate future feature #6 #12.
- Heikki posted client-side ALPN enforcement #7; Michael reviewed it, questioned querying ALPN outside direct mode, and separately discovered that PQsslAttribute() returned NULL where its documentation promised an empty string #9.
- Jacob clarified that the server also needed to reject incompatible ALPN protocols during the TLS handshake to prevent protocol confusion, rather than merely relying on client-side enforcement #10.
- Jacob's tests showed that requiredirect already reconnected after GSS rejection, contrary to misleading documentation and comments #13; Heikki supplied an independent documentation correction #14, which Jacob endorsed with a spelling fix #15.
- Robert and Jacob challenged combinations of direct negotiation with weak sslmode settings, while Heikki initially defended treating negotiation style separately from whether encryption was required and considered renaming requiredirect to directonly #18 #21 #20.
- Heikki supplied the server-side ALPN rejection patch, including a libpq workaround for OpenSSL's unhelpful error text for the no_application_protocol alert #23.
- The documentation correction landed as 5c9f35fc48 from #14, with only Jacob's spelling correction and comment rewrapping.
- Michael's PQsslAttribute() report #9 produced 3c18409265 without an attached patch, returning an empty string and adjusting psql's display; Heikki explained the distinction between unsupported ALPN and unused ALPN in #25.
- Client ALPN enforcement landed as 03a0e0d4bb, simplifying #7 into a direct-mode check inside open_client_SSL(), while the server rejection and error-message patch #23 landed unchanged as 17a834a04d.
- After the ALPN commits, Jacob reported apparent failures with traditional negotiation #28; Heikki explained that clients omitting ALPN still worked #30, and Jacob traced the failures to leftover local test code, so no revert or corrective patch followed #31.
- The broader debate explored ordered encryption preferences and stronger defaults without settling a new interface #24 #27; Daniel Gustafsson explained that sslrootcert=system's stricter behavior was intentional protection against unsafe combinations #35.
- Heikki then identified a concrete downgrade hazard: requiredirect combined with sslmode=prefer could fall back to plaintext against a pre-17 server that supported traditional SSL, leading him to propose removing fallback, renaming requiredirect to direct, and requiring sslmode=require or stronger #36.
- Jelte Fennema-Nio proposed automatically raising an unset sslmode #37, but Heikki preferred explicit configuration so that changing negotiation mode would not silently weaken encryption requirements #38; Jelte accepted reporting an error instead #39.
- Heikki posted the fallback-removal patch #41, Robert endorsed its design and implementation #45, and Jelte questioned first-character option comparisons #42; Heikki deferred a broader enum-based parsing cleanup because the existing pattern was widespread #44.
- Jacob found that the remaining method-selection code misleadingly suggested fallback between mutually exclusive SSL modes #51, prompting Heikki to merge them into ENC_SSL in the revised patch #54; Jacob endorsed the revision and flagged a redundant assertion #55.
- Related security-default proposals remained future work: Jacob argued against relying on channel binding alone and favored a simpler secure connection mode over additional quality-of-protection knobs #48 #52, while reporting that the OpenSSL alert-message workaround would remain necessary for supported older libraries #53.
- After Robert urged inclusion before beta1 #56 and Daniel endorsed the patch #57, Heikki committed #54 as fb5718f35f with the redundant assertion removed and announced completion #58.
- The thread ended with Robert's acknowledgment #59: all attached fixes had landed, while server-side negotiation controls and broader encryption-default changes remained future proposals.