java.lang.Object
java.lang.Thread
ch.qos.logback.classic.net.SimpleSocketServer
ch.qos.logback.classic.net.SimpleSSLSocketServer
- All Implemented Interfaces:
Runnable
A
SimpleSocketServer that supports SSL.
<b>Usage:</b> java ch.qos.logback.classic.net.SimpleSSLSocketServer port configFile
allowedAddress [allowedAddress ...]
where port is a port number where the server listens,
configFile is an XML configuration file fed to
JoranConfigurator, and each allowedAddress is a client IP
or CIDR range that is permitted to connect (e.g. 192.168.1.10 or
192.168.1.0/24). At least one allowed address must be specified on
the command line.
Client IP whitelisting configured via
SimpleSocketServer.addAllowedClientAddress(String) is mandatory and
applies here as well when the server is embedded programmatically. An empty
whitelist means no clients are allowed.
-Dname=value on the
command-line when starting the server. In particular, you will probably
want/need to configure the following system properties:
- javax.net.ssl.keyStore
- javax.net.ssl.keyStorePassword
- javax.net.ssl.keyStoreType
- javax.net.ssl.trustStore
- javax.net.ssl.trustStorePassword
- javax.net.ssl.trustStoreType
See the Customizing the JSSE in the JSSE Reference Guide for details on how to set these system properties.
- Author:
- Carl Harris
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleSSLSocketServer(LoggerContext lc, int port) Creates a new server using the default SSL context.SimpleSSLSocketServer(LoggerContext lc, int port, SSLContext sslContext) Creates a new server using a custom SSL context. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerSocketFactoryGets the platform defaultServerSocketFactory.static voidMethods inherited from class ch.qos.logback.classic.net.SimpleSocketServer
addAllowedClientAddress, close, configureLC, doMain, getClientThreadName, getLatch, getServerThreadName, isClientAllowed, isClosed, run, setAllowedClientAddresses, socketNodeClosingMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
SimpleSSLSocketServer
Creates a new server using the default SSL context.- Parameters:
lc- logger context for received eventsport- port on which the server is to listen- Throws:
NoSuchAlgorithmException- if the default SSL context cannot be created
-
SimpleSSLSocketServer
Creates a new server using a custom SSL context.- Parameters:
lc- logger context for received eventsport- port on which the server is to listensslContext- custom SSL context
-
-
Method Details
-
main
- Throws:
Exception
-
getServerSocketFactory
Description copied from class:SimpleSocketServerGets the platform defaultServerSocketFactory.Subclasses may override to provide a custom server socket factory.
- Overrides:
getServerSocketFactoryin classSimpleSocketServer
-