| | |
| | | public class ChildChannelHandler extends ChannelInitializer<SocketChannel> { |
| | | @Override |
| | | protected void initChannel(SocketChannel socketChannel) throws Exception { |
| | | // String path = "C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5\\cert\\SHA256withRSA_lzhyc.cn.pfx"; |
| | | // String path = "C:\\cert\\5084549_express.feimadache.com.pfx"; |
| | | // SSLContext sslContext = createSSLContext.createSSLContext("PKCS12" |
| | | // , path, "4zw2YVpF"); |
| | | // //SSLEngine 此类允许使用ssl安全套接层协议进行安全通信 |
| | | // SSLEngine engine = sslContext.createSSLEngine(); |
| | | // engine.setUseClientMode(false); |
| | | // socketChannel.pipeline().addLast("ssl", new SslHandler(engine)); |
| | | String path = "D:\\app\\cert\\tomcat\\9624329_www.zycx.ztrbkj.com.pfx"; |
| | | SSLContext sslContext = createSSLContext.createSSLContext("PKCS12" |
| | | , path, "v46h878e"); |
| | | //SSLEngine 此类允许使用ssl安全套接层协议进行安全通信 |
| | | SSLEngine engine = sslContext.createSSLEngine(); |
| | | engine.setUseClientMode(false); |
| | | socketChannel.pipeline().addLast("ssl", new SslHandler(engine)); |
| | | |
| | | // 设置30秒没有读到数据,则触发一个READER_IDLE事件。 |
| | | // pipeline.addLast(new IdleStateHandler(30, 0, 0)); |