public class NetServerOptions extends TCPSSLOptions
NetServer.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ACCEPT_BACKLOG
The default accept backlog = 1024
|
static ClientAuth |
DEFAULT_CLIENT_AUTH
Default value of whether client auth is required (SSL/TLS) = No
|
static String |
DEFAULT_HOST
The default host to listen on = "0.0.0.0" (meaning listen on all available interfaces).
|
static int |
DEFAULT_PORT
The default port to listen on = 0 (meaning a random ephemeral free port will be chosen)
|
static long |
DEFAULT_PROXY_PROTOCOL_TIMEOUT
The default value of HA PROXY protocol timeout = 10
|
static TimeUnit |
DEFAULT_PROXY_PROTOCOL_TIMEOUT_TIME_UNIT
Default HA PROXY protocol time unit = SECONDS
|
static boolean |
DEFAULT_SNI
Default value of whether the server supports SNI = false
|
static boolean |
DEFAULT_USE_PROXY_PROTOCOL
Default value of whether the server supports HA PROXY protocol = false
|
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_USE_ALPNDEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS| Constructor and Description |
|---|
NetServerOptions()
Default constructor
|
NetServerOptions(JsonObject json)
Create some options from JSON
|
NetServerOptions(NetServerOptions other)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
NetServerOptions |
addCrlPath(String crlPath)
Add a CRL path
|
NetServerOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
NetServerOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
NetServerOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
int |
getAcceptBacklog() |
ClientAuth |
getClientAuth() |
String |
getHost() |
int |
getPort() |
long |
getProxyProtocolTimeout() |
TimeUnit |
getProxyProtocolTimeoutUnit() |
boolean |
isSni() |
boolean |
isUseProxyProtocol() |
NetServerOptions |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
NetServerOptions |
setAcceptBacklog(int acceptBacklog)
Set the accept back log
|
NetServerOptions |
setClientAuth(ClientAuth clientAuth)
Set whether client auth is required
|
NetServerOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
NetServerOptions |
setHost(String host)
Set the host
|
NetServerOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
NetServerOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
NetServerOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
NetServerOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
NetServerOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
NetServerOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
NetServerOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
NetServerOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
NetServerOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
NetServerOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
NetServerOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
NetServerOptions |
setPort(int port)
Set the port
|
NetServerOptions |
setProxyProtocolTimeout(long proxyProtocolTimeout)
Set the Proxy protocol timeout, default time unit is seconds.
|
NetServerOptions |
setProxyProtocolTimeoutUnit(TimeUnit proxyProtocolTimeoutUnit)
Set the Proxy protocol timeout unit.
|
NetServerOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
NetServerOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
NetServerOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
NetServerOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
NetServerOptions |
setSni(boolean sni)
Set whether the server supports Server Name Indiciation
|
NetServerOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
NetServerOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
NetServerOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
NetServerOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
NetServerOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
NetServerOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
NetServerOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
NetServerOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
NetServerOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
NetServerOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
NetServerOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
NetServerOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
NetServerOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
NetServerOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
NetServerOptions |
setUseProxyProtocol(boolean useProxyProtocol)
Set whether the server uses the HA Proxy protocol
|
JsonObject |
toJson()
Convert to JSON
|
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTrustOptions, getTrustStoreOptions, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpngetLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePortpublic static final int DEFAULT_PORT
public static final String DEFAULT_HOST
public static final int DEFAULT_ACCEPT_BACKLOG
public static final ClientAuth DEFAULT_CLIENT_AUTH
public static final boolean DEFAULT_SNI
public static final boolean DEFAULT_USE_PROXY_PROTOCOL
public static final long DEFAULT_PROXY_PROTOCOL_TIMEOUT
public static final TimeUnit DEFAULT_PROXY_PROTOCOL_TIMEOUT_TIME_UNIT
public NetServerOptions()
public NetServerOptions(NetServerOptions other)
other - the options to copypublic NetServerOptions(JsonObject json)
json - the JSONpublic JsonObject toJson()
toJson in class TCPSSLOptionspublic NetServerOptions setSendBufferSize(int sendBufferSize)
NetworkOptionssetSendBufferSize in class TCPSSLOptionssendBufferSize - the buffers size, in bytespublic NetServerOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptionssetReceiveBufferSize in class TCPSSLOptionsreceiveBufferSize - the buffers size, in bytespublic NetServerOptions setReuseAddress(boolean reuseAddress)
NetworkOptionssetReuseAddress in class TCPSSLOptionsreuseAddress - the value of reuse addresspublic NetServerOptions setReusePort(boolean reusePort)
NetworkOptionssetReusePort in class TCPSSLOptionsreusePort - the value of reuse portpublic NetServerOptions setTrafficClass(int trafficClass)
NetworkOptionssetTrafficClass in class TCPSSLOptionstrafficClass - the value of traffic classpublic NetServerOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptionssetTcpNoDelay in class TCPSSLOptionstcpNoDelay - true if TCP no delay is enabled (Nagle disabled)public NetServerOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptionssetTcpKeepAlive in class TCPSSLOptionstcpKeepAlive - true if TCP keep alive is enabledpublic NetServerOptions setSoLinger(int soLinger)
TCPSSLOptionssetSoLinger in class TCPSSLOptionssoLinger - true if SO_linger is enabledpublic NetServerOptions setIdleTimeout(int idleTimeout)
TCPSSLOptionsTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)setIdleTimeout in class TCPSSLOptionsidleTimeout - the timeout, in secondspublic NetServerOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptionssetIdleTimeoutUnit in class TCPSSLOptionsidleTimeoutUnit - specify time unit.public NetServerOptions setSsl(boolean ssl)
TCPSSLOptionssetSsl in class TCPSSLOptionsssl - true if enabledpublic NetServerOptions setUseAlpn(boolean useAlpn)
TCPSSLOptionssetUseAlpn in class TCPSSLOptionsuseAlpn - true when Application-Layer Protocol Negotiation should be usedpublic NetServerOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptionssetSslEngineOptions in class TCPSSLOptionssslEngineOptions - the ssl engine to usepublic NetServerOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions in class TCPSSLOptionspublic NetServerOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions in class TCPSSLOptionspublic NetServerOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptionssetKeyCertOptions in class TCPSSLOptionsoptions - the key store optionspublic NetServerOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptionssetKeyStoreOptions in class TCPSSLOptionsoptions - the key store in jks formatpublic NetServerOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptionssetPfxKeyCertOptions in class TCPSSLOptionsoptions - the key cert options in pfx formatpublic NetServerOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class TCPSSLOptionsoptions - the options in pem formatpublic NetServerOptions setTrustOptions(TrustOptions options)
TCPSSLOptionssetTrustOptions in class TCPSSLOptionsoptions - the trust optionspublic NetServerOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class TCPSSLOptionsoptions - the trust options in jks formatpublic NetServerOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class TCPSSLOptionsoptions - the trust options in pfx formatpublic NetServerOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class TCPSSLOptionsoptions - the trust options in pem formatpublic NetServerOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class TCPSSLOptionssuite - the suitepublic NetServerOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsaddEnabledSecureTransportProtocol in class TCPSSLOptionsprotocol - the SSL/TLS protocol to enablepublic NetServerOptions removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsremoveEnabledSecureTransportProtocol in class TCPSSLOptionsprotocol - the SSL/TLS protocol to disablepublic NetServerOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptionsTCP_FASTOPEN option - only with linux native transport.setTcpFastOpen in class TCPSSLOptionstcpFastOpen - the fast open valuepublic NetServerOptions setTcpCork(boolean tcpCork)
TCPSSLOptionsTCP_CORK option - only with linux native transport.setTcpCork in class TCPSSLOptionstcpCork - the cork valuepublic NetServerOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptionsTCP_QUICKACK option - only with linux native transport.setTcpQuickAck in class TCPSSLOptionstcpQuickAck - the quick ack valuepublic NetServerOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptionsaddCrlPath in class TCPSSLOptionscrlPath - the pathNullPointerExceptionpublic NetServerOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptionsaddCrlValue in class TCPSSLOptionscrlValue - the valueNullPointerExceptionpublic NetServerOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptionssetEnabledSecureTransportProtocols in class TCPSSLOptionsenabledSecureTransportProtocols - the SSL/TLS protocols to enablepublic NetServerOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptionssetSslHandshakeTimeout in class TCPSSLOptionssslHandshakeTimeout - the SSL handshake timeout to set, in millisecondspublic NetServerOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptionssetSslHandshakeTimeoutUnit in class TCPSSLOptionssslHandshakeTimeoutUnit - specify time unit.public int getAcceptBacklog()
public NetServerOptions setAcceptBacklog(int acceptBacklog)
acceptBacklog - accept backlogpublic int getPort()
public NetServerOptions setPort(int port)
port - the portpublic String getHost()
public NetServerOptions setHost(String host)
host - the hostpublic ClientAuth getClientAuth()
public NetServerOptions setClientAuth(ClientAuth clientAuth)
clientAuth - One of "NONE, REQUEST, REQUIRED". If it's set to "REQUIRED" then server will require the
SSL cert to be presented otherwise it won't accept the request. If it's set to "REQUEST" then
it won't mandate the certificate to be presented, basically make it optional.public NetServerOptions setLogActivity(boolean logEnabled)
NetworkOptionssetLogActivity in class TCPSSLOptionslogEnabled - true for logging the network activitypublic boolean isSni()
public NetServerOptions setSni(boolean sni)
public boolean isUseProxyProtocol()
public NetServerOptions setUseProxyProtocol(boolean useProxyProtocol)
public long getProxyProtocolTimeout()
getProxyProtocolTimeoutUnit().public NetServerOptions setProxyProtocolTimeout(long proxyProtocolTimeout)
proxyProtocolTimeout - the Proxy protocol timeout to setpublic NetServerOptions setProxyProtocolTimeoutUnit(TimeUnit proxyProtocolTimeoutUnit)
proxyProtocolTimeoutUnit - specify time unit.public TimeUnit getProxyProtocolTimeoutUnit()
Copyright © 2021 Eclipse. All rights reserved.