public class SslHelper extends Object
Modifier and Type | Field and Description |
---|---|
static AttributeKey<Boolean> |
NEED_CLIENT_AUTH |
static AttributeKey<InetSocketAddress> |
PEER_ADDRESS
A session attribute key that should be set to an
InetSocketAddress . |
static AttributeKey<Boolean> |
WANT_CLIENT_AUTH |
Constructor and Description |
---|
SslHelper(IoSession session,
SSLContext sslContext)
Create a new SSL Handler.
|
Modifier and Type | Method and Description |
---|---|
void |
init()
Initialize the SSL handshake.
|
void |
processRead(AbstractIoSession session,
ByteBuffer readBuffer)
Process a read ByteBuffer over a secured connection, or during the SSL/TLS Handshake.
|
public static final AttributeKey<InetSocketAddress> PEER_ADDRESS
InetSocketAddress
. Setting this attribute causes
SSLContext.createSSLEngine(String, int)
to be called passing the hostname and port of the
InetSocketAddress
to get an SSLEngine
instance. If not set SSLContext.createSSLEngine()
will be called.SSLSession
objects may be cached and reused when in client mode.public static final AttributeKey<Boolean> WANT_CLIENT_AUTH
public static final AttributeKey<Boolean> NEED_CLIENT_AUTH
public SslHelper(IoSession session, SSLContext sslContext)
session
- The associated sessionpublic void init()
public void processRead(AbstractIoSession session, ByteBuffer readBuffer) throws SSLException
session
- The session we are processing a read forreadBuffer
- The data we get from the channelSSLException
- If the unwrapping or handshaking failedCopyright © 2009–2013 Apache MINA Project. All rights reserved.