Interface SslContextSource

All Known Subinterfaces:
ChainedProxy
All Known Implementing Classes:
ChainedProxyAdapter, KeyStoreSslContextSource, SelfSignedSslContextSource

public interface SslContextSource
Supplies TLS configuration for one side of a connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    configure(SSLSocket socket, boolean clientMode)
    Customizes a socket created from getSslContext() before its handshake (protocols, cipher suites, client authentication, ...).
    default KeyMaterial
    getKeyMaterial(String serverName)
    The certificate chain and private key this source presents as a TLS server, for listeners whose TLS is not the JDK's SSLContext: the HTTP/3 listener (HttpProxyServerBootstrap.withHttp3(boolean)) runs the TLS 1.3 handshake inside QUIC itself, and takes the certificate of the proxy's TLS listener from here.
    Returns the TLS context for this connection.
  • Method Details

    • getSslContext

      SSLContext getSslContext()
      Returns the TLS context for this connection.
      Returns:
      the TLS context for this connection
    • configure

      default void configure(SSLSocket socket, boolean clientMode)
      Customizes a socket created from getSslContext() before its handshake (protocols, cipher suites, client authentication, ...). The default does nothing.
      Parameters:
      socket - the TLS socket to configure
      clientMode - whether the proxy acts as the TLS client on this socket
    • getKeyMaterial

      default KeyMaterial getKeyMaterial(String serverName)
      The certificate chain and private key this source presents as a TLS server, for listeners whose TLS is not the JDK's SSLContext: the HTTP/3 listener (HttpProxyServerBootstrap.withHttp3(boolean)) runs the TLS 1.3 handshake inside QUIC itself, and takes the certificate of the proxy's TLS listener from here. SelfSignedSslContextSource and KeyStoreSslContextSource provide it; the default provides none, which leaves HTTP/3 off for this source.
      Parameters:
      serverName - the server name the client asked for (SNI), or null if it sent none
      Returns:
      the chain and key to present, or null if this source has none