SslNegotiator

internal object SslNegotiator

Handles PostgreSQL SSL negotiation protocol and socket upgrade.

Functions

Link copied to clipboard

Builds the effective SSL configuration for a connection.

Link copied to clipboard
fun negotiate(stream: PgStream, host: String, port: Int, config: SslConfiguration)

Asks the server for TLS and upgrades the connection if it agrees, before the startup message and so before any credential is on the wire.

Link copied to clipboard
fun upgrade(socket: Socket, host: String, port: Int, config: SslConfiguration): SSLSocket

Wraps an agreed socket in TLS and completes the handshake.