authenticate

fun authenticate(stream: PgStream, password: String?, mechanisms: List<String>, channelBinding: ChannelBinding): Boolean

Authenticates over stream using whichever of the two mechanisms mechanisms and channelBinding between them allow.

Return

true when the exchange was bound to the TLS channel, which is what lets the caller enforce ChannelBinding.REQUIRE over the whole login rather than over this step alone.

Throws

if no usable mechanism is on offer, the server violates the protocol, or its final signature does not verify.