Java 8 SSLEngine - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SSLEngine class.

This code example shows how to use the following methods: setEnabledCipherSuites, setEnabledProtocols, setUseClientMode
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setUseClientMode
            { 
                TrustingX509Manager.getInstance() 
            }, null ); 
 
            SSLEngine engine = context.createSSLEngine();
            engine.setUseClientMode( true );
 
            ch.pipeline().addLast( "ssl", new SslHandler( engine ) );
        } 
        ch.pipeline().addLast( "http", new HttpClientCodec() );
        ch.pipeline().addLast( "handler", new HttpHandler( callback ) );
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSession, setUseClientMode
 
        // set the property before initialization SSLEngine. 
        System.setProperty("jsse.SSLEngine.acceptLargeFragments", "true");
 
        SSLEngine cliEngine = context.createSSLEngine();
        cliEngine.setUseClientMode(true);
 
        SSLEngine srvEngine = context.createSSLEngine();
        srvEngine.setUseClientMode(false);
 
        SSLSession cliSession = cliEngine.getSession();
        SSLSession srvSession = srvEngine.getSession();
 
        // check packet buffer sizes. 
        if (cliSession.getPacketBufferSize() < 33049 ||
            srvSession.getPacketBufferSize() < 33049) {
                throw new Exception("Don't accept large SSL/TLS fragments");
        } 
 
        // check application data buffer sizes. 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setUseClientMode
		// Create a default pipeline implementation. 
		ChannelPipeline pipeline = pipeline();
 
		SSLContext sslContext = getSSLContext();
		SSLEngine sslEngine = sslContext.createSSLEngine();
		sslEngine.setUseClientMode(false);
		SslHandler sslHandler = new SslHandler(sslEngine);
 
		pipeline.addLast("ssl", sslHandler);
 
		pipeline.addLast("broker-encoder", new BrokerEncoderRouter());
		pipeline.addLast("broker-decoder", new BrokerDecoderRouter(GcsInfo.getMessageMaxSize()));
 
		if (GcsInfo.useAccessControl()) 
		{ 
			pipeline.addLast("broker-auth-filter", new AuthorizationFilter());
		} 
 
		pipeline.addLast("broker-handler", BrokerProtocolHandler.getInstance());
		return pipeline;
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getSession, setUseClientMode
 
  public SecureSocketWrapper(SocketWrapper wrapper) throws NoSuchAlgorithmException {
    this.channel = wrapper.getSocket();
    SSLContext context = SSLContext.getDefault();
    sslEngine = context.createSSLEngine();
    sslEngine.setUseClientMode(true);
    in = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize());
    unwrappedIn = ByteBuffer.allocate(sslEngine.getSession().getApplicationBufferSize());
    out = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize());
    empty = ByteBuffer.allocate(0);
  } 
 
  @Override 
  public SelectionKey register(Selector sel, int ops) throws ClosedChannelException {
    return channel.register(sel, ops);
  } 
 
  @Override 
  public boolean connect(SocketAddress remote) throws IOException {
    return channel.connect(remote);
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Java 8 SSLEngine Methods: