Interface ClientAltSvcConfig

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
ClientAltSvcConfig.BuilderBase.ClientAltSvcConfigImpl

public interface ClientAltSvcConfig extends Prototype.Api
Preview client policy for accepting and using HTTP Alt-Svc response advertisements.

Alternative service handling is opt-in through HttpClientConfig.altSvc(). Supporting client protocols use this policy only for HTTPS origins and same-host alternative authorities. Clear-text HTTP origins, including an opportunistic transition from HTTP to TLS, and cross-host alternatives are not supported.

The client applies its configured TLS settings without additional restrictions when connecting to an alternative service. Unsafe TLS settings, such as trusting all certificates, therefore make alternative service handling correspondingly unsafe. Helidon honors the configured TLS policy and does not require its built-in trust manager.

See Also:
  • Method Details

    • builder

      static ClientAltSvcConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static ClientAltSvcConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static ClientAltSvcConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • enabled

      boolean enabled()
      Whether alternative service handling is enabled.

      This option defaults to true. Setting it to false disables alternative service handling even when this configuration is present.

      Returns:
      whether alternative service handling is enabled
    • protocols

      Set<String> protocols()
      Allowed alternative service protocol identifiers.

      An empty set permits every available client protocol that supports alternative services. A non-empty set is an exact, case-sensitive allow-list of opaque ALPN protocol identifiers; it is not validated against the protocols currently provided by the client. Each Java character in the range U+0000 through U+00FF maps one-to-one to an identifier byte. Each identifier must contain between 1 and 255 bytes, inclusive, when this policy is enabled.

      Returns:
      allowed alternative service protocol identifiers