Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Npgsql/Internal/NpgsqlConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ static async Task OpenCore(
//
// Any error after trying with GSS encryption
(gssEncMode == GssEncryptionMode.Prefer ||
// Auth error with/without SSL
(sslMode == SslMode.Prefer && conn.IsSslEncrypted || sslMode == SslMode.Allow && !conn.IsSslEncrypted))
// Any error after trying with/without SSL but we're allowed to retry
sslMode == SslMode.Prefer || sslMode == SslMode.Allow)
{
if (gssEncMode == GssEncryptionMode.Prefer)
{
Expand Down Expand Up @@ -970,6 +970,10 @@ async Task SetupEncryption(SslMode sslMode, GssEncryptionMode gssEncryptionMode,
var response = (char)ReadBuffer.ReadByte();
timeout.CheckAndApply(this);

// TODO: Server can respond with an error here
// but according to documentation we shouldn't display this error to the user/application
// since the server has not been authenticated (CVE-2024-10977)
// See https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-SSL
switch (response)
{
default:
Expand Down
Loading