* byte here.
*/
conn->status = CONNECTION_AWAITING_RESPONSE;
+
+ /*
+ * Don't fall back to a plaintext connection after
+ * reading the error.
+ */
+ conn->failed_enc_methods |= conn->allowed_enc_methods & (~conn->current_enc_method);
goto keep_going;
}
else
* into AWAITING_RESPONSE state and let the code there
* deal with it. Note we have *not* consumed the "E"
* byte here.
+ *
+ * Note that unlike on an error response to
+ * SSLRequest, we allow falling back to SSL or
+ * plaintext connection here. GSS support was
+ * introduced in PostgreSQL version 12, so an error
+ * response might mean that we are connecting to a
+ * pre-v12 server.
*/
conn->status = CONNECTION_AWAITING_RESPONSE;
goto keep_going;
}
else if (pollres == PGRES_POLLING_FAILED)
{
+ /*
+ * GSS handshake failed. We will retry with an SSL or
+ * plaintext connection, if permitted by the options.
+ */
CONNECTION_FAILED();
}
/* Else, return POLLING_READING or POLLING_WRITING status */