Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.config

public Class TlsConfig

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Annotations
@Contract
threading:IMMUTABLE
Imports
java.util.Arrays, java.util.concurrent.TimeUnit, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.ssl.TLS, org.apache.hc.core5.http2.HttpVersionPolicy, org.apache.hc.core5.util.Timeout

Immutable class encapsulating TLS protocol settings.
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final TlsConfig
private final Timeout
private final HttpVersionPolicy
private final String[]
private final String[]

Constructor Summary

AccessConstructor and Description
protected
TlsConfig()

Intended for CDI compatibility

pack-priv
TlsConfig(final Timeout handshakeTimeout, final String[] supportedProtocols, final String[] supportedCipherSuites, final HttpVersionPolicy httpVersionPolicy)

Method Summary

Modifier and TypeMethod and Description
protected TlsConfig
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public static TlsConfig.Builder
copy(final TlsConfig config)

public static TlsConfig.Builder
public Timeout
public HttpVersionPolicy
public String[]
public String[]
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULTback to summary
public static final TlsConfig DEFAULT
handshakeTimeoutback to summary
private final Timeout handshakeTimeout
httpVersionPolicyback to summary
private final HttpVersionPolicy httpVersionPolicy
supportedCipherSuitesback to summary
private final String[] supportedCipherSuites
supportedProtocolsback to summary
private final String[] supportedProtocols

Constructor Detail

TlsConfigback to summary
protected TlsConfig()

Intended for CDI compatibility

TlsConfigback to summary
pack-priv TlsConfig(final Timeout handshakeTimeout, final String[] supportedProtocols, final String[] supportedCipherSuites, final HttpVersionPolicy httpVersionPolicy)

Method Detail

cloneback to summary
protected TlsConfig clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:TlsConfig

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
copyback to summary
public static TlsConfig.Builder copy(final TlsConfig config)
customback to summary
public static TlsConfig.Builder custom()
getHandshakeTimeoutback to summary
public Timeout getHandshakeTimeout()
See Also
Builder#setHandshakeTimeout(Timeout)
getHttpVersionPolicyback to summary
public HttpVersionPolicy getHttpVersionPolicy()
See Also
Builder#setVersionPolicy(HttpVersionPolicy)
getSupportedCipherSuitesback to summary
public String[] getSupportedCipherSuites()
See Also
Builder#setSupportedCipherSuites(String...)
getSupportedProtocolsback to summary
public String[] getSupportedProtocols()
See Also
Builder#setSupportedProtocols(String...)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.hc.client5.http.config back to summary

public Class TlsConfig.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Timeout
private String[]
private String[]
private HttpVersionPolicy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TlsConfig
public TlsConfig.Builder
setHandshakeTimeout(final Timeout handshakeTimeout)

Determines the timeout used by TLS session negotiation exchanges (session handshake).

public TlsConfig.Builder
setHandshakeTimeout(final long handshakeTimeout, final TimeUnit timeUnit)

public TlsConfig.Builder
setSupportedCipherSuites(final String... supportedCipherSuites)

Determines supported cipher suites.

public TlsConfig.Builder
setSupportedProtocols(final String... supportedProtocols)

Determines supported TLS protocols.

public TlsConfig.Builder
setSupportedProtocols(final TLS... supportedProtocols)

Determines supported TLS protocols.

public TlsConfig.Builder
setVersionPolicy(final HttpVersionPolicy versionPolicy)

Determines the HTTP protocol policy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handshakeTimeoutback to summary
private Timeout handshakeTimeout
supportedCipherSuitesback to summary
private String[] supportedCipherSuites
supportedProtocolsback to summary
private String[] supportedProtocols
versionPolicyback to summary
private HttpVersionPolicy versionPolicy

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public TlsConfig build()
setHandshakeTimeoutback to summary
public TlsConfig.Builder setHandshakeTimeout(final Timeout handshakeTimeout)

Determines the timeout used by TLS session negotiation exchanges (session handshake).

A timeout value of zero is interpreted as an infinite timeout.

Default: null (undefined)

setHandshakeTimeoutback to summary
public TlsConfig.Builder setHandshakeTimeout(final long handshakeTimeout, final TimeUnit timeUnit)
See Also
setHandshakeTimeout(Timeout)
setSupportedCipherSuitesback to summary
public TlsConfig.Builder setSupportedCipherSuites(final String... supportedCipherSuites)

Determines supported cipher suites.

Default: null (undefined)

setSupportedProtocolsback to summary
public TlsConfig.Builder setSupportedProtocols(final String... supportedProtocols)

Determines supported TLS protocols.

Default: null (undefined)

setSupportedProtocolsback to summary
public TlsConfig.Builder setSupportedProtocols(final TLS... supportedProtocols)

Determines supported TLS protocols.

Default: null (undefined)

setVersionPolicyback to summary
public TlsConfig.Builder setVersionPolicy(final HttpVersionPolicy versionPolicy)

Determines the HTTP protocol policy. By default, connections are expected to use TLS ALPN extension to negotiate the application protocol to be used by both endpoints.

Default: HttpVersionPolicy#NEGOTIATE