Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ChannelPipeline cp = ch.pipeline();
  2. SelfSignedCertificate cert = new SelfSignedCertificate();
  3. SslContext cont = SslContext.newServerContext(
  4. cert.certificate(), cert.privateKey());
  5. cp.addLast("ssl", cont.newHandler(ch.alloc()));
  6.  
  7. ChannelPipeline pipeline = ch.pipeline();
  8. SslContext cont = SslContext
  9. .newClientContext(InsecureTrustManagerFactory.INSTANCE);
  10. pipeline.addLast(cont.newHandler(ch.alloc(),
  11. HOST, SERVER_SECURE_PORT));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement