Package org.asynchttpclient
Interface SslEngineFactory
-
- All Known Implementing Classes:
DefaultSslEngineFactory,JsseSslEngineFactory,SslEngineFactoryBase
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SslEngineFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voiddestroy()Perform any necessary cleanup.default voidinit(AsyncHttpClientConfig config)Perform any necessary one-time configuration.SSLEnginenewSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort)Creates a newSSLEngine.default SSLEnginenewSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort, boolean http2Allowed)Creates a newSSLEngine, optionally permitting HTTP/2 (ALPNh2) negotiation.
-
-
-
Method Detail
-
newSslEngine
SSLEngine newSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort)
Creates a newSSLEngine.- Parameters:
config- the client configpeerHost- the peer hostnamepeerPort- the peer port- Returns:
- new engine
-
newSslEngine
default SSLEngine newSslEngine(AsyncHttpClientConfig config, String peerHost, int peerPort, boolean http2Allowed)
Creates a newSSLEngine, optionally permitting HTTP/2 (ALPNh2) negotiation.WebSocket connections pass
http2Allowed = false: AsyncHttpClient does not implement RFC 8441 (WebSocket over HTTP/2), so a WebSocket connection must not negotiateh2— otherwise the handshake is written as a plain HTTP/2 request and corrupts the connection. The default implementation ignores the flag and delegates tonewSslEngine(AsyncHttpClientConfig, String, int)for backwards compatibility;DefaultSslEngineFactoryoverrides it to advertise onlyhttp/1.1in ALPN whenhttp2Allowedisfalse.- Parameters:
config- the client configpeerHost- the peer hostnamepeerPort- the peer porthttp2Allowed- whether HTTP/2 (ALPNh2) may be negotiated on this connection- Returns:
- new engine
-
init
default void init(AsyncHttpClientConfig config) throws SSLException
Perform any necessary one-time configuration. This will be called just once beforenewSslEngineis called for the first time.- Parameters:
config- the client config- Throws:
SSLException- if initialization fails. If an exception is thrown, the instance will not be used as client creation will fail.
-
destroy
default void destroy()
Perform any necessary cleanup.
-
-