Enum SslNegotiation

java.lang.Object
java.lang.Enum<SslNegotiation>
io.vertx.pgclient.SslNegotiation
All Implemented Interfaces:
Serializable, Comparable<SslNegotiation>

public enum SslNegotiation extends Enum<SslNegotiation>
SSL negotiation mode for PostgreSQL connections.

Determines how SSL/TLS is negotiated with the PostgreSQL server. This setting controls the negotiation protocol, while SslMode controls whether encryption is required.

See Also:
  • Enum Constant Details

    • POSTGRES

      public static final SslNegotiation POSTGRES
      Traditional PostgreSQL SSL negotiation (default).

      The client sends an SSL request message and waits for the server's response before establishing the SSL connection. This mode works with all PostgreSQL versions.

    • DIRECT

      public static final SslNegotiation DIRECT
      Direct SSL negotiation (PostgreSQL 17+).

      The client establishes an SSL connection immediately without sending an SSL request message. This mode:

      • Reduces connection latency by one round-trip
      • Enables standard SSL proxies (nginx, haproxy) to terminate TLS
      • Supports SNI/ALPN protocol negotiation

      Note: Requires PostgreSQL 17 or later. Attempting to use this mode with earlier PostgreSQL versions will result in an SSL handshake failure.

  • Field Details

  • Method Details

    • values

      public static SslNegotiation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SslNegotiation valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static SslNegotiation of(String value)
      Parse the SSL negotiation mode from a string value.
      Parameters:
      value - the string value (case-insensitive)
      Returns:
      the corresponding SSL negotiation mode
      Throws:
      IllegalArgumentException - if the value is not recognized