Class SslSocketManager
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ByteBufferDestination
public class SslSocketManager extends TcpSocketManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSslSocketManager.SslFactoryDataprivate static classSslSocketManager.SslSocketManagerFactory-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.net.TcpSocketManager
TcpSocketManager.FactoryData, TcpSocketManager.HostResolver, TcpSocketManager.TcpSocketManagerFactory<M extends TcpSocketManager,T extends TcpSocketManager.FactoryData>
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractManager
AbstractManager.AbstractFactoryData
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORTprivate static SslSocketManager.SslSocketManagerFactoryFACTORYprivate SslConfigurationsslConfig-
Fields inherited from class org.apache.logging.log4j.core.net.TcpSocketManager
DEFAULT_RECONNECTION_DELAY_MILLIS
-
Fields inherited from class org.apache.logging.log4j.core.net.AbstractSocketManager
host, inetAddress, port
-
Fields inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
byteBuffer, layout
-
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
-
-
Constructor Summary
Constructors Constructor Description SslSocketManager(java.lang.String name, java.io.OutputStream os, java.net.Socket sock, SslConfiguration sslConfig, java.net.InetAddress inetAddress, java.lang.String host, int port, int connectTimeoutMillis, int reconnectionDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize)SslSocketManager(java.lang.String name, java.io.OutputStream os, java.net.Socket sock, SslConfiguration sslConfig, java.net.InetAddress inetAddress, java.lang.String host, int port, int connectTimeoutMillis, int reconnectionDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize, SocketOptions socketOptions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) static javax.net.ssl.SNIHostNamecreateSniHostName(java.lang.String hostName){@return an {@link SNIHostName} instance if the provided host name is not an IP literal (RFC 6066), and constitutes a valid host name (RFC 1035); null otherwise}private static java.net.SocketcreateSocket(java.lang.String hostName, java.net.InetSocketAddress socketAddress, int connectTimeoutMillis, SslConfiguration sslConfiguration, SocketOptions socketOptions)protected java.net.SocketcreateSocket(java.net.InetSocketAddress socketAddress)private static java.lang.StringcreateSslConfigurationId(SslConfiguration sslConfig)Creates a unique identifier using the certificate issuers and serial numbers of the given SSL configuration.private static javax.net.ssl.SSLSocketFactorycreateSslSocketFactory(SslConfiguration sslConf)static SslSocketManagergetSocketManager(SslConfiguration sslConfig, java.lang.String host, int port, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize)static SslSocketManagergetSocketManager(SslConfiguration sslConfig, java.lang.String host, int port, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize, SocketOptions socketOptions)-
Methods inherited from class org.apache.logging.log4j.core.net.TcpSocketManager
closeOutputStream, createSocket, getConnectTimeoutMillis, getContentFormat, getReconnectionDelayMillis, getSocket, getSocketManager, getSocketManager, getSocketOptions, setHostResolver, toString, write
-
Methods inherited from class org.apache.logging.log4j.core.net.AbstractSocketManager
getHost, getPort
-
Methods inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
createOutputStream, drain, flush, flushBuffer, flushDestination, getByteBuffer, getManager, getOutputStream, hasOutputStream, isOpen, releaseSub, setOutputStream, skipFooter, write, write, write, writeBytes, writeBytes, writeFooter, writeHeader, writeToDestination
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
close, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
FACTORY
private static final SslSocketManager.SslSocketManagerFactory FACTORY
-
sslConfig
private final SslConfiguration sslConfig
-
-
Constructor Detail
-
SslSocketManager
@Deprecated public SslSocketManager(java.lang.String name, java.io.OutputStream os, java.net.Socket sock, SslConfiguration sslConfig, java.net.InetAddress inetAddress, java.lang.String host, int port, int connectTimeoutMillis, int reconnectionDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize)Deprecated.- Parameters:
name- the unique name of this connectionos- the OutputStreamsock- the SocketinetAddress- the Internet address of the hosthost- the name of the hostport- the port number on the hostconnectTimeoutMillis- the connect timeout in millisecondsreconnectionDelayMillis- Reconnection interval.immediateFail- True if the write should fail if no socket is immediately available.layout- the LayoutbufferSize- The buffer size.
-
SslSocketManager
public SslSocketManager(java.lang.String name, java.io.OutputStream os, java.net.Socket sock, SslConfiguration sslConfig, java.net.InetAddress inetAddress, java.lang.String host, int port, int connectTimeoutMillis, int reconnectionDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize, SocketOptions socketOptions)- Parameters:
name- The unique name of this connection.os- The OutputStream.sock- The Socket.inetAddress- The Internet address of the host.host- The name of the host.port- The port number on the host.connectTimeoutMillis- the connect timeout in milliseconds.reconnectionDelayMillis- Reconnection interval.immediateFail- True if the write should fail if no socket is immediately available.layout- The Layout.bufferSize- The buffer size.
-
-
Method Detail
-
getSocketManager
@Deprecated public static SslSocketManager getSocketManager(SslConfiguration sslConfig, java.lang.String host, int port, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize)
-
getSocketManager
public static SslSocketManager getSocketManager(SslConfiguration sslConfig, java.lang.String host, int port, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, Layout<? extends java.io.Serializable> layout, int bufferSize, SocketOptions socketOptions)
-
createSslConfigurationId
private static java.lang.String createSslConfigurationId(SslConfiguration sslConfig)
Creates a unique identifier using the certificate issuers and serial numbers of the given SSL configuration.- Parameters:
sslConfig- an SSL configuration- Returns:
- a unique identifier extracted from the given SSL configuration
-
createSocket
protected java.net.Socket createSocket(java.net.InetSocketAddress socketAddress) throws java.io.IOException- Overrides:
createSocketin classTcpSocketManager- Throws:
java.io.IOException
-
createSslSocketFactory
private static javax.net.ssl.SSLSocketFactory createSslSocketFactory(SslConfiguration sslConf)
-
createSocket
private static java.net.Socket createSocket(java.lang.String hostName, java.net.InetSocketAddress socketAddress, int connectTimeoutMillis, SslConfiguration sslConfiguration, SocketOptions socketOptions) throws java.io.IOException- Throws:
java.io.IOException
-
createSniHostName
static javax.net.ssl.SNIHostName createSniHostName(java.lang.String hostName)
{@return an {@link SNIHostName} instance if the provided host name is not an IP literal (RFC 6066), and constitutes a valid host name (RFC 1035); null otherwise}- Parameters:
hostName- a host name- See Also:
- Literal IPv4 and IPv6 addresses are not permitted in "HostName" (RFC 6066), Domain Names - Implementation and Specification (RFC 1035)
-
-