- Notifications
You must be signed in to change notification settings - Fork28
Commit41a6de4
committed
Fix confusing error caused by connection parameter channel_binding
When using a client compiled without channel binding support (linking toOpenSSL 1.0.1 or older) to connect to a server which supports channelbinding (linking to OpenSSL 1.0.2 or newer), libpq would generate aconfusing error message with channel_binding=require for an SSLconnection, where the server sends back SCRAM-SHA-256-PLUS:"channel binding is required, but server did not offer an authenticationmethod that supports channel binding."This is confusing because the server did send a SASL mechanism able tosupport channel binding, but libpq was not able to detect thatproperly.The situation can be summarized as followed for the case described inthe previous paragraph for the SASL mechanisms used with the variousmodes of channel_binding:1) Client supports channel binding.1-1) channel_binding = disable => OK, with SCRAM-SHA-256.1-2) channel_binding = prefer => OK, with SCRAM-SHA-256-PLUS.1-3) channel_binding = require => OK, with SCRAM-SHA-256-PLUS.2) Client does not support channel binding.2-1) channel_binding = disable => OK, with SCRAM-SHA-256.2-2) channel_binding = prefer => OK, with SCRAM-SHA-256.2-3) channel_binding = require => failure with new error message,instead of the confusing one.This commit updates case 2-3 to generate a better error message. Notethat the SSL TAP tests are not impacted as it is not possible to testwith mixed versions of OpenSSL for the backend and libpq.Reported-by: Tom LaneAuthor: Michael PaquierReviewed-by: Jeff Davis, Tom LaneDiscussion:https://postgr.es/m/24857.1569775891@sss.pgh.pa.us1 parent5dd7fc1 commit41a6de4
1 file changed
+18
-4
lines changedLines changed: 18 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
| 474 | + | |
| 475 | + | |
| 476 | + | |
474 | 477 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
| 478 | + | |
| 479 | + | |
478 | 480 |
| |
479 |
| - | |
480 | 481 |
| |
481 | 482 |
| |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
482 | 496 |
| |
483 | 497 |
| |
484 | 498 |
| |
|
0 commit comments
Comments
(0)