本文整理匯總了Java中org.jboss.netty.handler.ssl.SslHandler.handshake方法的典型用法代碼示例。如果您正苦於以下問題:Java SslHandler.handshake方法的具體用法?Java SslHandler.handshake怎麽用?Java SslHandler.handshake使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.netty.handler.ssl.SslHandler
的用法示例。
在下文中一共展示了SslHandler.handshake方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception
{
if (LOG.isTraceEnabled()) {
LOG.trace("Channel connected " + e);
}
NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
zkServer, NettyServerCnxnFactory.this);
ctx.setAttachment(cnxn);
if (secure) {
SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn));
} else {
allChannels.add(ctx.getChannel());
addCnxn(cnxn);
}
}
示例2: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception
{
if (LOG.isTraceEnabled()) {
LOG.trace("Channel connected " + e);
}
NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
zkServer, NettyServerCnxnFactory.this);
ctx.setAttachment(cnxn);
//SECUREKEEPER: Enable ssl only if specified
//if (secure) {
if(encryption.equals("ssl")){
SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn));
} else {
allChannels.add(ctx.getChannel());
addCnxn(cnxn);
}
}
示例3: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(final ChannelHandlerContext ctx, final ChannelStateEvent e) {
//prevent javax.net.ssl.SSLException: Received close_notify during handshake
final SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
if (sslHandler == null) {
return;
}
final ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(final ChannelFuture future) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("Node to Node encryption cipher is {}/{}", sslHandler.getEngine().getSession().getProtocol(), sslHandler
.getEngine().getSession().getCipherSuite());
}
ctx.sendUpstream(e);
}
});
}
示例4: operationComplete
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (future.isSuccess()) {
SslHandler handler = new SslHandler(engine);
future.getChannel().getPipeline().addFirst(SSL_HANDLER_KEY, handler);
handler.handshake();
}
}
示例5: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
log.info("Connected to " + ctx.getChannel().getRemoteAddress());
this.channel = ctx.getChannel();
final SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(this);
super.channelConnected(ctx, e);
}
示例6: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception
{
LOG.debug("Initiating SSL handshake with {}", ctx.getChannel().getRemoteAddress());
SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
sslHandler.handshake();
}
示例7: channelConnected
import org.jboss.netty.handler.ssl.SslHandler; //導入方法依賴的package包/類
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
ctx.setAttachment(e.getValue());
// Get the SslHandler in the current pipeline.
final SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
sslHandler.setEnableRenegotiation(false);
// Get notified when SSL handshake is done.
ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new SslListener());
}