资源简介
netty的client和server端建立SSL连接,并进行双向的证书验证
代码片段和文件信息
package com.aerohive.ahccd.channel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import java.nio.channels.SocketChannel;
import java.util.List;
public class AhccdServerSocketChannel extends NioServerSocketChannel
{
private static final InternalLogger logger = InternalLoggerFactory.getInstance(AhccdServerSocketChannel.class);
@Override
protected int doReadMessages(Listject> buf) throws Exception
{
SocketChannel ch = javaChannel().accept();
try
{
if (ch != null)
{
buf.add(new AhccdSocketChannel(this ch));
return 1;
}
} catch (Throwable t)
{
logger.warn(“Failed to create a new channel from an accepted socket.“ t);
try
{
ch.close();
} catch (Throwable t2)
{
logger.warn(“Failed to close a socket.“ t2);
}
}
return 0;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-01-18 15:10 ahccd\
文件 1397 2015-01-14 11:27 ahccd\.classpath
文件 534 2015-01-06 10:48 ahccd\.project
目录 0 2015-01-14 11:27 ahccd\.settings\
文件 90 2015-01-14 11:27 ahccd\.settings\org.eclipse.core.resources.prefs
文件 238 2015-01-14 11:27 ahccd\.settings\org.eclipse.jdt.core.prefs
文件 86 2015-01-06 10:48 ahccd\.settings\org.eclipse.m2e.core.prefs
文件 1851 2015-01-14 11:22 ahccd\pom.xm
文件 179 2015-01-18 15:52 ahccd\ReadMe.txt
目录 0 2015-01-06 10:48 ahccd\src\
目录 0 2015-01-06 10:48 ahccd\src\main\
目录 0 2015-01-13 15:49 ahccd\src\main\java\
目录 0 2015-01-07 11:05 ahccd\src\main\java\com\
目录 0 2015-01-07 11:05 ahccd\src\main\java\com\aerohive\
目录 0 2015-01-18 15:08 ahccd\src\main\java\com\aerohive\ahccd\
目录 0 2015-01-14 15:01 ahccd\src\main\java\com\aerohive\ahccd\channel\
文件 929 2015-01-14 15:04 ahccd\src\main\java\com\aerohive\ahccd\channel\AhccdServerSocketChannel.java
文件 495 2015-01-15 16:38 ahccd\src\main\java\com\aerohive\ahccd\channel\AhccdSocketChannel.java
目录 0 2015-01-13 15:53 ahccd\src\main\java\com\aerohive\ahccd\client\
文件 2548 2015-01-13 15:53 ahccd\src\main\java\com\aerohive\ahccd\client\Client.java
文件 2294 2015-01-13 15:53 ahccd\src\main\java\com\aerohive\ahccd\client\ClientInitializer.java
目录 0 2015-01-13 16:06 ahccd\src\main\java\com\aerohive\ahccd\handler\
文件 836 2015-01-13 16:04 ahccd\src\main\java\com\aerohive\ahccd\handler\CertParseHandler.java
文件 1153 2015-01-13 15:48 ahccd\src\main\java\com\aerohive\ahccd\handler\ClientHandler.java
文件 2709 2015-01-13 16:06 ahccd\src\main\java\com\aerohive\ahccd\handler\ServerHandler.java
目录 0 2015-01-15 16:40 ahccd\src\main\java\com\aerohive\ahccd\server\
文件 1071 2015-01-14 15:01 ahccd\src\main\java\com\aerohive\ahccd\server\Server.java
文件 1480 2015-01-13 15:50 ahccd\src\main\java\com\aerohive\ahccd\server\ServerInitializer.java
文件 2982 2015-01-15 16:40 ahccd\src\main\java\com\aerohive\ahccd\server\SslContextFactory.java
目录 0 2015-01-18 15:40 ahccd\src\main\resources\
目录 0 2015-01-18 15:40 ahccd\src\main\resources\cert\
............此处省略48个文件信息
评论
共有 条评论