Package org.microproxy
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 TypeMethodDescriptiondefault voidCustomizes a socket created fromgetSslContext()before its handshake (protocols, cipher suites, client authentication, ...).default KeyMaterialgetKeyMaterial(String serverName) The certificate chain and private key this source presents as a TLS server, for listeners whose TLS is not the JDK'sSSLContext: 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
Customizes a socket created fromgetSslContext()before its handshake (protocols, cipher suites, client authentication, ...). The default does nothing.- Parameters:
socket- the TLS socket to configureclientMode- whether the proxy acts as the TLS client on this socket
-
getKeyMaterial
The certificate chain and private key this source presents as a TLS server, for listeners whose TLS is not the JDK'sSSLContext: 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.SelfSignedSslContextSourceandKeyStoreSslContextSourceprovide 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
-