當前位置: 首頁>>代碼示例>>Java>>正文


Java SslHandler.handshake方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:didichuxing2,項目名稱:https-github.com-apache-zookeeper,代碼行數:22,代碼來源:NettyServerCnxnFactory.java

示例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);
    }
}
 
開發者ID:sereca,項目名稱:SecureKeeper,代碼行數:24,代碼來源:NettyServerCnxnFactory.java

示例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);
        }
    });
}
 
開發者ID:petalmd,項目名稱:armor,代碼行數:23,代碼來源:ArmorMessageChannelHandler.java

示例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();
	}
}
 
開發者ID:kenweezy,項目名稱:teiid,代碼行數:9,代碼來源:PgBackendProtocol.java

示例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);
}
 
開發者ID:formicary,項目名稱:remoterun,代碼行數:10,代碼來源:RemoteRunAgent.java

示例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();
}
 
開發者ID:ppdai,項目名稱:rest4j,代碼行數:8,代碼來源:SecureClientHandler.java

示例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());
}
 
開發者ID:eBay,項目名稱:restcommander,代碼行數:11,代碼來源:SslPlayHandler.java


注:本文中的org.jboss.netty.handler.ssl.SslHandler.handshake方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。